cniweb builds a new image for apifant swagger editor #32
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 Image | |
run-name: ${{ github.actor }} builds a new image for apifant swagger editor | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
env: | |
EDITOR_IMAGE: ghcr.io/huk-coburg/apifant-editor | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Generate Docker Image Tag | |
run: echo "EDITOR_TAG=$(date +%Y%m%d-%H%M%S)" >> $GITHUB_ENV | |
- name: Build the Docker Image | |
run: docker build --file Dockerfile --tag ${EDITOR_IMAGE}:${EDITOR_TAG} . | |
- name: Tag the Docker Image | |
run: docker tag ${EDITOR_IMAGE}:${EDITOR_TAG} ${EDITOR_IMAGE}:latest | |
- name: Docker Login | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username "${{ github.actor }}" --password-stdin | |
- name: Push CI Tag | |
run: docker push ${EDITOR_IMAGE}:${EDITOR_TAG} | |
- name: Push Latest Tag | |
run: docker push ${EDITOR_IMAGE}:latest |