Skip to content

Merge pull request #41 from LacledesLAN/dependabot/github_actions/doc… #182

Merge pull request #41 from LacledesLAN/dependabot/github_actions/doc…

Merge pull request #41 from LacledesLAN/dependabot/github_actions/doc… #182

name: linux/amd64
on:
schedule:
- cron: '0 7 * * 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
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/[email protected]
- name: Pull Latest Linux Base Image
run: docker pull debian:bullseye-slim
- name: Build Linux Image
uses: docker/[email protected]
with:
context: .
file: ./linux.Dockerfile
tags: |
lacledeslan/gamesvr-dods:latest
ghcr.io/lacledeslan/gamesvr-dods: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-dods:latest /app/ll-tests/gamesvr-dods.sh
- name: Login to DockerHub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: ${{ github.event_name != 'pull_request' }}
uses: docker/[email protected]
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-dods:latest
- name: Push to GitHub Packages
if: ${{ github.event_name != 'pull_request' }}
run: docker push ghcr.io/lacledeslan/gamesvr-dods:latest
- name: Trigger downstream build of lacledeslan/gamesvr-dods-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-dods-freeplay/dispatches