2020-11-22 02:50:48 +02:00
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
2020-11-22 03:40:44 +02:00
|
|
|
test-npm:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
2020-11-22 02:50:48 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
- run: make app/bundle
|
2020-11-22 03:40:44 +02:00
|
|
|
test-go:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
2020-11-22 03:51:53 +02:00
|
|
|
go: ['1.14', '1.15', '1']
|
2020-11-22 03:40:44 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-11-22 03:51:53 +02:00
|
|
|
name: test-go ${{ matrix.go }} (${{ matrix.os }})
|
2020-11-22 03:40:44 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-11-22 03:51:53 +02:00
|
|
|
- name: Setup go
|
|
|
|
uses: actions/setup-go@v2
|
2020-11-22 03:40:44 +02:00
|
|
|
with:
|
2020-11-22 03:51:53 +02:00
|
|
|
go-version: ${{ matrix.go }}
|
2020-11-22 03:40:44 +02:00
|
|
|
- run: cd src; go test ./...
|
2020-11-22 05:54:15 +02:00
|
|
|
docker-push:
|
|
|
|
runs-on: ubuntu-latest
|
2020-11-22 05:59:36 +02:00
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/github-actions'
|
2020-11-22 05:54:15 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
- uses: actions/setup-go@v2
|
2020-11-22 06:02:34 +02:00
|
|
|
- uses: docker/setup-buildx-action@v1
|
2020-11-22 05:54:15 +02:00
|
|
|
- name: Login to dockerhub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- run: make build; cp build/factorio-server-manager-linux.zip docker/factorio-server-manager-linux.zip
|
|
|
|
- id: docker_build
|
|
|
|
uses: docker/build-push-action@v2
|
2020-11-22 05:57:14 +02:00
|
|
|
with:
|
2020-11-22 06:06:58 +02:00
|
|
|
context: docker/
|
|
|
|
file: ./Dockerfile-local
|
2020-11-22 05:57:14 +02:00
|
|
|
push: true
|
|
|
|
tags: ofsm/ofsm:github-actions
|