Nuke pretty much everything #67
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: build | |
on: [pull_request, push] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
java: [ | |
8, | |
] | |
# run only on Linux | |
os: [ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v3 | |
- name: "Set up QEMU" | |
uses: docker/setup-qemu-action@v2 | |
- name: "Set up Docker Buildx" | |
uses: docker/setup-buildx-action@v2 | |
- name: validate gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: setup jdk ${{ matrix.java }} | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: ${{ matrix.java }} | |
- name: make gradle wrapper executable | |
if: ${{ runner.os != 'Windows' }} | |
run: chmod +x ./gradlew | |
- name: build | |
run: ./gradlew build | |
- name: capture build artifacts | |
if: ${{ runner.os == 'Linux' }} # upload artifacts from one OS | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Artifacts | |
path: build/libs/ | |
- name: "Login to DockerHub" | |
uses: docker/login-action@v2 | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: "Build and push" | |
id: docker_build | |
uses: docker/build-push-action@v3 | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
with: | |
context: ./build/docker/ | |
platforms: "linux/amd64,linux/arm64" | |
push: true | |
tags: | | |
aizistral/infinite-machine:latest | |
- name: Run playbook | |
uses: dawidd6/action-ansible-playbook@v2 | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
with: | |
playbook: deploy.yml | |
directory: ./ansible/ | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
# Literal inventory file contents | |
inventory: | | |
[all] | |
${{ secrets.SSH_DOMAIN }} ansible_connection=ssh ansible_user=${{ secrets.SSH_USERNAME }} |