Skip to content

0.0.0

0.0.0 #3

Workflow file for this run

name: Retag & Push
on:
release:
types: [created]
env:
ARTIFACT_NAME: hello-world-app
jobs:
retag_push_qa:
runs-on: ubuntu-latest
outputs:
sha_short: ${{ steps.prepare.outputs.sha_short }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Preparing job
id: prepare
run: |
SHA_SHORT=$(echo $GITHUB_SHA | cut -c1-7)
echo "SHA_SHORT=$SHA_SHORT" >> $GITHUB_ENV
echo "::set-output name=sha_short::$SHA_SHORT"
- name: Retag and push Docker Image with Release Name
run: |
docker pull kennyd3d/${{ env.ARTIFACT_NAME }}:$SHA_SHORT
docker tag kennyd3d/${{ env.ARTIFACT_NAME }}:$SHA_SHORT kennyd3d/${{ env.ARTIFACT_NAME }}:${{ github.event.release.tag_name }}
docker push kennyd3d/${{ env.ARTIFACT_NAME }}:${{ github.event.release.tag_name }}
Deploy:
name: Deploy 🚀
needs: retag_push_qa
uses: ./.github/workflows/deploy.yml
with:
namespace: "qa"
image: "kennyd3d/hello-world-app:${{ needs.retag_push_qa.outputs.sha_short }}"
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}