bedrocktool/.github/workflows/build.yml

59 lines
1.4 KiB
YAML
Raw Normal View History

2022-08-11 20:22:39 +00:00
name: ci-build
on:
2022-09-06 07:41:49 +00:00
push:
2022-10-30 16:37:39 +00:00
workflow_dispatch:
2022-08-11 20:22:39 +00:00
jobs:
2022-08-21 17:31:16 +00:00
build:
2022-08-11 20:22:39 +00:00
name: Build
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
2022-08-11 20:38:49 +00:00
with:
fetch-depth: 0
2022-10-30 17:09:55 +00:00
- run: |
2022-10-30 17:11:13 +00:00
git fetch --force --tags
2022-08-11 21:06:36 +00:00
2022-08-11 20:22:39 +00:00
- uses: actions/setup-go@v3
with:
go-version: '1.19'
check-latest: true
cache: true
2022-08-21 17:31:16 +00:00
2022-09-04 14:30:20 +00:00
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: git-crypt xxd
version: 1.0
2022-08-12 17:55:51 +00:00
- name: decrypt
2022-08-21 17:31:16 +00:00
if: ${{ !env.ACT }}
2022-08-12 17:55:51 +00:00
run: |
echo ${REPO_KEY} | xxd -r -p > ../bedrock-repo-key.key
git-crypt unlock ../bedrock-repo-key.key
rm ../bedrock-repo-key.key
env:
REPO_KEY: ${{ secrets.REPO_KEY }}
2022-08-21 17:31:16 +00:00
2022-09-05 22:09:33 +00:00
- run: go install github.com/sanbornm/go-selfupdate/cmd/go-selfupdate
2022-09-04 14:28:09 +00:00
- run: go get ./cmd/bedrocktool
2022-08-11 20:22:39 +00:00
2022-09-05 21:57:11 +00:00
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
2022-09-05 22:02:52 +00:00
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
2022-09-05 21:57:11 +00:00
2022-08-21 17:31:16 +00:00
- name: build
2022-10-30 16:49:54 +00:00
id: build
run: |
2022-10-30 16:50:50 +00:00
make -j dists updates
2022-09-05 21:57:11 +00:00
- name: Deploy with rsync
run: rsync -avz ./public/ olebeck@${{ secrets.SSH_HOST }}:/var/www/updates/bedrocktool/
2022-08-21 17:31:16 +00:00
2022-09-04 11:22:34 +00:00
- uses: "marvinpinto/action-automatic-releases@latest"
2022-08-21 17:31:16 +00:00
with:
2022-09-04 11:21:18 +00:00
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: dist/*
2022-09-04 11:27:17 +00:00
prerelease: false