-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (48 loc) · 1.71 KB
/
docker-ci.yaml
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
50
51
52
53
54
55
56
57
name: Docker CI
on:
push:
branches:
- main
pull_request_target: {}
# By specifying the access of one of the scopes, all of those that are not specified are set to 'none'.
permissions:
# To be able to access the repository with `actions/checkout`
contents: read
jobs:
build:
name: Build & Push
runs-on: ubuntu-22.04
steps:
- name: Getting image tag
id: tag
run: |
tag="${{ github.sha }}"
if [[ "${{ github.event.pull_request.head.sha }}" != "" ]]; then
echo "Detected PR SHA ${{ github.event.pull_request.head.sha }}"
tag="${{ github.event.pull_request.head.sha }}"
fi
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "TAG: ${tag}"
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ steps.tag.outputs.tag }}
persist-credentials: false
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2.7.0
- name: Login to quay.io
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
registry: quay.io
username: ${{ secrets.QUAY_CI_USERNAME }}
password: ${{ secrets.QUAY_CI_TOKEN }}
- name: Build & Push Docker Image
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
quay.io/${{ github.repository_owner }}/team-manager-ci:${{ steps.tag.outputs.tag }}