Skip to content

Timings CI - release #34

Timings CI - release

Timings CI - release #34

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Timings CI - release
on:
workflow_run:
workflows: ["Timings CI - test"]
branches: [main]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
outputs:
release-outputs: ${{ steps.release.outputs }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install node modules and run tests
run: |
npm ci --ignore-scripts
- name: Semantic Release [PUBLISH]
uses: ./.github/actions/semantic
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
publish: true
add-summary: true
- name: Set up Docker Buildx
if: steps.release.outputs.new_release_published == 'true'
id: buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
if: steps.release.outputs.new_release_published == 'true'
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
if: steps.release.outputs.new_release_published == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Build and Push
if: steps.release.outputs.new_release_published == 'true'
id: docker_build
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: |
godaddy/timings:latest
godaddy/timings:${{ steps.release.outputs.new_release_version }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: |
echo ${{ steps.docker_build.outputs.digest }}
echo Docker image was published sucessfully! >> $GITHUB_STEP_SUMMARY
echo - Image ID: **${{ steps.docker_build.outputs.imageid }}** >> $GITHUB_STEP_SUMMARY
echo - digest: **${{ steps.docker_build.outputs.digest }}** >> $GITHUB_STEP_SUMMARY
echo - metadata: **${{ steps.docker_build.outputs.metadata }}** >> $GITHUB_STEP_SUMMARY