Docker publish #28
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: Docker publish | |
concurrency: production | |
on: | |
workflow_run: | |
workflows: [ "Playwright" ] | |
branches: [ master ] | |
types: | |
- completed | |
env: | |
dockerhub_gui_image: hugocker/jarm_online_gui | |
dockerhub_api_image: hugocker/jarm_online_api | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build GUI image | |
run: docker build jarm_online_gui/ --build-arg VUE_APP_SENTRY_DSN=${{secrets.VUE_APP_SENTRY_DSN}} -t jarm_online_gui | |
- name: Build API image | |
run: docker build . -t jarm_online_api | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push build images | |
run: | | |
docker tag jarm_online_gui $dockerhub_gui_image:build-$GITHUB_RUN_ID | |
docker push $dockerhub_gui_image:build-$GITHUB_RUN_ID | |
docker tag jarm_online_api $dockerhub_api_image:build-$GITHUB_RUN_ID | |
docker push $dockerhub_api_image:build-$GITHUB_RUN_ID | |
- name: Tag latest | |
run: | | |
docker tag $dockerhub_gui_image:build-$GITHUB_RUN_ID $dockerhub_gui_image | |
docker tag $dockerhub_api_image:build-$GITHUB_RUN_ID $dockerhub_api_image | |
- name: Publish latest | |
run: | | |
docker push $dockerhub_gui_image | |
docker push $dockerhub_api_image |