Skip to content

Update launcher to use the Design System #327

Update launcher to use the Design System

Update launcher to use the Design System #327

Workflow file for this run

name: PR
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: "1.21.x"
- name: Checkout code
uses: actions/checkout@v3
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: go get
- name: Build
run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: Go linting
uses: golangci/golangci-lint-action@v4
with:
version: v1.57
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "npm"
- name: Install npm deps
run: npm install
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.2
virtualenvs-create: true
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'poetry'
- name: Install virtual environment
run: |
sudo apt-get install libsnappy-dev
poetry install
- name: Templates linting
run: make lint-templates
- name: Static linting
run: make lint-static
docker-push:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Tag
run: |
CLEAN_TAG=$(echo "${{ github.event.pull_request.head.ref }}" | tr / -)
echo "TAG=$CLEAN_TAG" >> $GITHUB_ENV
- name: Build
run: >
docker build -t onsdigital/eq-questionnaire-launcher:$TAG
-t ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/eq-questionnaire-launcher:$TAG .
- name: Push to Docker Hub
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
echo "Pushing with tag [$TAG]"
docker push onsdigital/eq-questionnaire-launcher:$TAG
- name: Push to GAR
env:
GAR_SERVICE_KEY: ${{ secrets.GAR_SERVICE_KEY }}
run: |
echo $GAR_SERVICE_KEY | docker login -u _json_key --password-stdin https://${{ secrets.GAR_LOCATION }}
gcloud auth configure-docker ${{ secrets.GAR_LOCATION }}
echo "Pushing to GAR with tag $TAG"
docker push ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/eq-questionnaire-launcher:$TAG