forked from SoftwareEngineeringToolDemos/FSE-2011-PSPWizard
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.34 KB
/
dockerBuildAndPush.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Docker build and publish to GHCR
on:
push:
branches:
- master
release:
types: [published] # will use tag name regardless of naming
jobs:
build_and_publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout current Repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Log in to the Container registry
run: docker login --username Cambio-Project --password ${{secrets.PUBLISH_PACKAGES}} ghcr.io
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
EXECUTION_ENV=ci
GITHUB_PACKAGE_READ_TOKEN=${{ secrets.PUBLISH_PACKAGES }}