Publish Image Using Sha and Timestamp #159
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: Publish Image Using Sha and Timestamp | |
on: | |
workflow_run: | |
workflows: [ "Test and build backend" ] | |
types: | |
- completed | |
jobs: | |
push: | |
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.name == 'Test and build backend' && github.event.workflow_run.head_branch == 'main' }} | |
name: Publish Image using commit sha and timestamp | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Push backend image on the registry | |
uses: Ferlab-Ste-Justine/action-push-image@v2 | |
with: | |
username: ${{ secrets.FERLAB_DOCKER_HUB_USER }} | |
password: ${{ secrets.FERLAB_DOCKER_HUB_TOKEN }} | |
image: ferlabcrsj/radiant-api | |
tag_format: "{sha}-{timestamp}" | |
location: ./backend | |
dockerfile: ./backend/Dockerfile | |
- name: Push frontend image on the registry | |
uses: Ferlab-Ste-Justine/action-push-image@v2 | |
with: | |
username: ${{ secrets.FERLAB_DOCKER_HUB_USER }} | |
password: ${{ secrets.FERLAB_DOCKER_HUB_TOKEN }} | |
image: ferlabcrsj/radiant-portal | |
tag_format: "{sha}-{timestamp}" | |
location: ./frontend | |
dockerfile: ./frontend/Dockerfile.radiant |