semicolon #45
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: Platform Racing 2 | |
on: [push] | |
permissions: | |
packages: write | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Lint | |
run: | | |
composer install | |
./vendor/bin/phpmd common,functions,http_server,multiplayer_server,policy_server text unusedcode | |
./vendor/bin/phpcs --standard=PSR2 common functions http_server multiplayer_server policy_server | |
- name: Build HTTP | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
docker build -t pr2-http --file docker/http_server.dockerfile . | |
tag="$(date +%F-%H-%M)-$GITHUB_REF_NAME-$GITHUB_SHA" | |
docker tag pr2-http ghcr.io/jacob-grahn/platform-racing-2-http:latest | |
docker push ghcr.io/jacob-grahn/platform-racing-2-http:latest | |
docker tag pr2-http ghcr.io/jacob-grahn/platform-racing-2-http:$tag | |
docker push ghcr.io/jacob-grahn/platform-racing-2-http:$tag | |
- name: Build Multi | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
docker build -t pr2-multi --file docker/multi_server.dockerfile . | |
tag="$(date +%F-%H-%M)-$GITHUB_REF_NAME-$GITHUB_SHA" | |
docker tag pr2-multi ghcr.io/jacob-grahn/platform-racing-2-multi:latest | |
docker push ghcr.io/jacob-grahn/platform-racing-2-multi:latest | |
docker tag pr2-multi ghcr.io/jacob-grahn/platform-racing-2-multi:$tag | |
docker push ghcr.io/jacob-grahn/platform-racing-2-multi:$tag |