-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd7b5c2
commit 2fee647
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Build Docker image Steam-Watcher | ||
|
||
on: | ||
schedule: | ||
- cron: '0 5 * * 1' | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
env: | ||
TITLE: Steam Watcher | ||
# github.repository as <account>/<repo> | ||
GHCR_SLUG: ghcr.io/lifeismana/steam-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/[email protected] | ||
|
||
# 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/[email protected] | ||
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/[email protected] | ||
with: | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ env.GHCR_SLUG }}:latest | ||
cache-from: ${{ env.GHCR_SLUG }}:latest | ||
labels: ${{ steps.meta.outputs.labels }} |