spiff-arena/.github/workflows/create-docker-action.yml

58 lines
1.4 KiB
YAML
Raw Normal View History

name: run_ci
on:
workflow_dispatch:
2022-11-17 13:17:51 -05:00
push:
branches: ['feature/releases'] # just for testing for a bit.
2022-11-17 13:27:56 -05:00
tags:
- 'v*'
pull_request:
branches:
- 'main'
release:
types: [published]
env:
REGISTRY: ghcr.io
BACKEND_IMAGE: spiffworkflow-backend
jobs:
2022-11-17 13:56:51 -05:00
build-and-push-backend-docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
2022-11-17 13:27:56 -05:00
uses: actions/checkout@v3
2022-11-17 13:27:56 -05:00
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: name/app
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
2022-11-17 13:56:51 -05:00
# Setting up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Backend Docker Image
2022-11-17 13:27:56 -05:00
uses: docker/build-push-action@v3
with:
2022-11-17 13:56:51 -05:00
context: "{{defaultContext}}:spiffworkflow-backend"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2022-11-17 13:56:51 -05:00