linux/amd64 #112
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
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 | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Pull Latest Linux Base Image | |
run: docker pull debian:bullseye-slim | |
- name: Build Linux Image | |
uses: docker/build-push-action@v4.1.1 | |
with: | |
context: . | |
file: ./linux.Dockerfile | |
tags: | | |
lacledeslan/gamesvr-garrysmod:latest | |
ghcr.io/lacledeslan/gamesvr-garrysmod: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-garrysmod:latest /app/ll-tests/gamesvr-garrysmod.sh | |
- name: Login to DockerHub | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@v2.2.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@v2.2.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-garrysmod:latest | |
- name: Push to GitHub Packages | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker push ghcr.io/lacledeslan/gamesvr-garrysmod:latest |