-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.48 KB
/
functest-to-ghcr-on-push.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: functest Docker Image on Push to GHCR
on:
push:
branches-ignore:
- main
paths:
- 'src/**'
- 'requirements.txt'
- 'Dockerfile'
workflow_dispatch:
jobs:
skip_ci:
runs-on: ubuntu-latest
# Map the output to the job's outputs
outputs:
canSkip: ${{ steps.check.outputs.canSkip }}
steps:
- id: check
uses: Legorooj/skip-ci@main
build_and_push_docker_to_ghcr:
# Wait for the skip_ci job to run
needs: skip_ci
# And only run the build if canSkip isn't 'true'.
if: ${{ needs.skip_ci.outputs.canSkip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Docker meta Service Name for docker hub
id: docker_meta_img_hub
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository_owner }}/functest
tags: |
type=match,value={{branch}},pattern=.*\d,suffix=-latest
- name: Log into registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push ${{ github.repository }}
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.docker_meta_img_hub.outputs.tags }}
labels: ${{ steps.docker_meta_img_hub.outputs.labels }}