0.0.2 #5
Workflow file for this run
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
name: Retag & Push | |
on: | |
release: | |
types: [created] | |
env: | |
ARTIFACT_NAME: hello-world-app | |
jobs: | |
retag_push_qa: | |
runs-on: ubuntu-latest | |
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 | |
- 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:${{ github.event.release.tag_name }}" | |
secrets: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} |