Timings CI - release #30
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
# 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@v3 | |
- 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@v2 | |
- name: Cache Docker layers | |
if: steps.release.outputs.new_release_published == 'true' | |
uses: actions/cache@v2 | |
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@v2 | |
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@v4 | |
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 |