-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (62 loc) · 2.56 KB
/
build-linux-image.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
66
name: linux/amd64
on:
schedule:
- cron: '0 8 * * THU'
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
- name: Pull Latest Linux Base Image
run: docker pull debian:stable-slim
- name: Build Linux Image
uses: docker/build-push-action@v5.2.0
with:
context: .
file: ./linux.Dockerfile
tags: |
lacledeslan/gamesvr-jk2outcast:latest
ghcr.io/lacledeslan/gamesvr-jk2outcast:latest
build-args: |
BUILDNODE=GitHub (Run Number: ${{ github.run_number }} Run ID: ${{ github.run_id }})
SOURCE_COMMIT=${{ github.sha }}
no-cache: true
# - name: Test Linux Image
# run: docker run --rm lacledeslan/gamesvr-jk2outcast:latest /app/ll-tests/gamesvr-jk2outcast.sh
- name: Login to DockerHub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Push to Docker HUB
if: ${{ github.event_name != 'pull_request' }}
run: docker push lacledeslan/gamesvr-jk2outcast:latest
- name: Push to GitHub Packages
if: ${{ github.event_name != 'pull_request' }}
run: docker push ghcr.io/lacledeslan/gamesvr-jk2outcast:latest
- name: Trigger downstream build of lacledeslan/gamesvr-jk2outcast-freeplay
if: ${{ github.event_name != 'pull_request' }}
run: |-
curl -XPOST -u "${{ secrets.GH_PAT_USERNAME }}:${{ secrets.GH_PAT_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" \
--data '{"event_type": "${{ github.repository }} was updated", "client_payload": {"Run Number":"${{ github.run_number }}", "Run ID":"${{ github.run_id }}", "Source Commit":"${{ github.sha }}"}}' \
https://api.github.com/repos/LacledesLAN/gamesvr-jk2outcast-freeplay/dispatches