Skip to content

Commit

Permalink
Merge pull request #14 from Dahlgren/fix/linter-yaml-warnings
Browse files Browse the repository at this point in the history
Fix YAML warnings in linters
  • Loading branch information
BrettMayson committed Aug 11, 2022
2 parents 428dfc3 + f3f9008 commit 1a3831c
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 55 deletions.
1 change: 1 addition & 0 deletions .github/linters/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
ignored:
- DL3008 # Pinned apt versions
102 changes: 55 additions & 47 deletions .github/workflows/ghcr.yaml
Original file line number Diff line number Diff line change
@@ -1,66 +1,74 @@
---
name: Publish Docker

on: [push]
on:
push:

env:
IMAGE_TAG: ghcr.io/${{ github.repository_owner }}/arma-reforger:edge

jobs:
build:
name: Build Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Image
run: docker build . -t arma-reforger
- name: Save Image
run: docker save arma-reforger | gzip > image.tar.gz
- uses: actions/upload-artifact@v2
with:
name: image
path: image.tar.gz
if-no-files-found: error
retention-days: 7
- uses: actions/checkout@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Image
run: docker build . -t arma-reforger
- name: Save Image
run: docker save arma-reforger | gzip > image.tar.gz
- uses: actions/upload-artifact@v2
with:
name: image
path: image.tar.gz
if-no-files-found: error
retention-days: 7

test:
name: Test Image
runs-on: ubuntu-latest
needs: [ build ]
needs:
- build
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@v2
with:
name: image
- name: Load Image
run: docker load < image.tar.gz
- name: Run Image
run: docker run -d -p 17777:17777/udp arma-reforger
- name: Install python dependencies
run: python3 -m pip install python-a2s
- name: Run Test
run: python3 ./.github/scripts/steam-query.py
- uses: actions/checkout@master
- uses: actions/download-artifact@v2
with:
name: image
- name: Load Image
run: docker load < image.tar.gz
- name: Run Image
run: docker run -d -p 17777:17777/udp arma-reforger
- name: Install python dependencies
run: python3 -m pip install python-a2s
- name: Run Test
run: python3 ./.github/scripts/steam-query.py

main_publish:
name: Publish Image
runs-on: ubuntu-latest
needs: [ build, test ]
needs:
- build
- test
if: github.ref == 'refs/heads/main'
steps:
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v2
with:
name: image
- name: Load Image
run: docker load < image.tar.gz
- name: Tag Image
run: docker tag arma-reforger ghcr.io/${{ github.repository_owner }}/arma-reforger:edge
- name: Push Image
run: docker push ghcr.io/${{ github.repository_owner }}/arma-reforger:edge
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v2
with:
name: image
- name: Load Image
run: docker load < image.tar.gz
- name: Tag Image
run: docker tag arma-reforger "$IMAGE_TAG"
- name: Push Image
run: docker push "$IMAGE_TAG"
20 changes: 12 additions & 8 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
---
name: Lint

on: [push, pull_request]
on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Lint
uses: github/super-linter@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Lint
uses: github/super-linter@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YAML_ERROR_ON_WARNING: true
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: '3.8'
services:
arma-reforger:
Expand Down

0 comments on commit 1a3831c

Please sign in to comment.