Update dependency govuk-frontend to v4.9.0 #370
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
name: Publish | |
env: | |
REPO_NAME: 'rpe/response-frontend' | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
CI: true | |
steps: | |
- uses: actions/checkout@v3 | |
- name: use node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
registry-url: https://registry.npmjs.org/ # Needed for auth | |
cache: 'yarn' | |
- name: yarn install | |
run: yarn install --frozen-lockfile | |
- name: lint | |
run: yarn lint | |
- name: build | |
run: yarn build | |
- name: test | |
run: yarn test | |
- name: test:routes | |
run: yarn test:routes | |
- name: a11y | |
run: yarn test:a11y | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Get Short Sha Hash" | |
id: get-short-sha | |
uses: actions/[email protected] | |
with: | |
script: | | |
const shortSha = context.sha.substring(0, 7) | |
core.setOutput('shortSha', shortSha) | |
- name: 'Get Commit Timestamp' | |
id: get-timestamp | |
run: | | |
TIMESTAMP=$(git log -1 --format='%cI' | sed -e's/[-T:]//g' -e's/+.*$//g') | |
echo "::set-output name=timestamp::$TIMESTAMP" | |
- name: 'Build and push image' | |
uses: azure/docker-login@v1 | |
with: | |
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }} | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- run: | | |
docker build . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/${{ env.REPO_NAME }}:pr-${{github.event.number}}-${{ steps.get-short-sha.outputs.shortSha }} | |
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/${{ env.REPO_NAME }}:pr-${{github.event.number}}-${{ steps.get-short-sha.outputs.shortSha }} | |
if: startsWith(github.ref, 'refs/pull') | |
- run: | | |
docker build . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/${{ env.REPO_NAME }}:prod-${{ steps.get-short-sha.outputs.shortSha }}-${{ steps.get-timestamp.outputs.timestamp }} | |
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/${{ env.REPO_NAME }}:prod-${{ steps.get-short-sha.outputs.shortSha }}-${{ steps.get-timestamp.outputs.timestamp }} | |
if: github.ref == 'refs/heads/master' |