Merge pull request #223 from Enraged-Dun-Cookie-Development-Team/fix-… #159
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Docker build CI | |
on: | |
# for debug | |
# pull_request: | |
push: | |
branches: [ master ] | |
tags: | |
- "v*" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- | |
name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
run: | | |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- | |
name: Build and push release | |
uses: docker/build-push-action@v4 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
context: . | |
push: true | |
tags: ceobecanteen/ceobe-canteen-server:${{ env.TAG_NAME }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
provenance: false | |
sbom: false | |
- | |
name: Build and push latest | |
uses: docker/build-push-action@v4 | |
if: "!startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'" | |
with: | |
context: . | |
push: true | |
tags: ceobecanteen/ceobe-canteen-server | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
provenance: false | |
sbom: false | |
- | |
name: Build and push debug | |
uses: docker/build-push-action@v4 | |
if: "github.event_name == 'pull_request'" | |
with: | |
context: . | |
push: true | |
tags: ceobecanteen/ceobe-canteen-server:${{ github.sha }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
provenance: false | |
sbom: false | |