Skip to content

feat(chore): push images to dockerhub #9

feat(chore): push images to dockerhub

feat(chore): push images to dockerhub #9

Workflow file for this run

---
name: Docker Push
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
# workflow_run:
# workflows: ["Tag"]
# types:
# - completed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_push_poc:
name: Build & Push Image - POC
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set output
id: vars
run: |
echo "git_tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
echo "DOCKERHUB_TOKEN=${{ secrets.SF_REF_ARCH_DOCKERHUB_TOKEN }}" >> $GITHUB_OUTPUT
echo "DOCKERHUB_USERNAME=${{ secrets.SF_REF_ARCH_DOCKERHUB_USERNAME }}" >> $GITHUB_OUTPUT
# configure iam
- name: Configure IAM Role
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.POC_BACKSTAGE_DEPLOY_ARN }}
aws-region: us-east-1
continue-on-error: false
- name: Build, Tag, and Push
run: |
export IMAGE_TAG=${{ steps.vars.outputs.git_tag }}
export ENVIRONMENT=poc
export DOCKERHUB_TOKEN=${{ secrets.SF_ARCH_DOCKERHUB_PASSWORD }}
export DOCKERHUB_USERNAME=${{ secrets.SF_ARCH_DOCKERHUB_USERNAME }}
export POC_BACKSTAGE_DEPLOY_ARN=${{ secrets.POC_BACKSTAGE_DEPLOY_ARN }}
./scripts/docker-build-tag-and-push.sh
# build_and_push_prod:
# name: Build & Push Image - Prod
# runs-on: ubuntu-latest
# permissions:
# id-token: write
# contents: read
# pull-requests: write
# # if: ${{ github.event.workflow_run.conclusion == 'success' }}
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Set output
# id: vars
# run: echo "git_tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
# # configure iam
# - name: Configure IAM Role
# uses: aws-actions/configure-aws-credentials@v2
# with:
# role-to-assume: ${{ secrets.PROD_BACKSTAGE_DEPLOY_ARN }}
# aws-region: us-east-1
# continue-on-error: false
# - name: Build, Tag, and Push
# run: |
# export IMAGE_TAG=${{ steps.vars.outputs.git_tag }}
# export ENVIRONMENT=prod
# ./scripts/docker-build-tag-and-push.sh