Skip to content

Instantly share code, notes, and snippets.

@jmerle
Created July 15, 2020 21:07
Show Gist options
  • Save jmerle/3187803778f7b6bd112b13ddb77441da to your computer and use it in GitHub Desktop.
Save jmerle/3187803778f7b6bd112b13ddb77441da to your computer and use it in GitHub Desktop.
The GitHub Actions workflow I use in the ICFP Programming Contest 2020
name: Build
on:
push:
branches-ignore:
- submission
pull_request:
branches-ignore:
- submission
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build
run: ./gradlew shadowJar
- name: Prepare submission
run: |
cp -r submission ../submission
cp build/libs/icfpc-2020.jar ../submission/icfpc-2020.jar
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
- name: Push submission
run: |
git checkout submission --
git rm -rf .
git clean -fxd
cp -r ../submission/. .
git add -A
git config --local user.name "GitHub Actions"
git config --local user.email "actions@users.noreply.github.com"
git commit -m "Auto-submit from build #$GITHUB_RUN_NUMBER"
git push
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment