-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.8 KB
/
build.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build Docker image APK Watcher
on:
schedule:
- cron: '0 5 * * 1'
push:
branches: [ "main" ]
paths:
- 'setup.sh'
- 'Dockerfile'
- '.github/workflows/build.yml'
concurrency:
group: ${{ github.workflow }}
env:
TITLE: Steam APK Watcher
# github.repository as <account>/<repo>
GHCR_SLUG: ghcr.io/lifeismana/steam-apk-watcher
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.GHCR_SLUG }}
labels: |
maintainer=${{ github.repository_owner }}
org.opencontainers.image.vendor=${{ github.repository_owner }}
org.opencontainers.image.title=${{ env.TITLE }}
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3.3.0
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5.3.0
with:
#context: "{{defaultContext}}:Docker"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.GHCR_SLUG }}:latest
cache-from: ${{ env.GHCR_SLUG }}:latest
labels: ${{ steps.meta.outputs.labels }}