2021-08-29 04:04:40 +02:00
|
|
|
name: linux/amd64
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 8 * * THU'
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-push:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-03-02 12:21:43 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-08-29 04:04:40 +02:00
|
|
|
- name: Set up QEMU
|
2022-05-06 13:24:31 +02:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2021-08-29 04:04:40 +02:00
|
|
|
- name: Pull Latest Linux Base Image
|
|
|
|
run: docker pull debian:bullseye-slim
|
|
|
|
- name: Build Linux Image
|
2022-03-15 12:13:55 +01:00
|
|
|
uses: docker/build-push-action@v2.10.0
|
2021-08-29 04:04:40 +02:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./linux.Dockerfile
|
|
|
|
tags: |
|
|
|
|
lacledeslan/gamesvr-ut99:latest
|
|
|
|
ghcr.io/lacledeslan/gamesvr-ut99: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-ut99:latest /app/ll-tests/gamesvr-ut99.sh
|
|
|
|
- name: Login to DockerHub
|
|
|
|
if: ${{ github.event_name != 'pull_request' }}
|
2022-03-02 12:21:40 +01:00
|
|
|
uses: docker/login-action@v1.14.1
|
2021-08-29 04:04:40 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
if: ${{ github.event_name != 'pull_request' }}
|
2022-03-02 12:21:40 +01:00
|
|
|
uses: docker/login-action@v1.14.1
|
2021-08-29 04:04:40 +02:00
|
|
|
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-ut99:latest
|
|
|
|
- name: Push to GitHub Packages
|
|
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
|
|
run: docker push ghcr.io/lacledeslan/gamesvr-ut99:latest
|
|
|
|
# - name: Trigger downstream build of lacledeslan/gamesvr-ut99-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-ut99-freeplay/dispatches
|