Build #449
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 | |
env: | |
PACKAGE_NAME: 'ghcr.io/seia-soto/shadowbox' | |
ARCH: 'linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6' | |
on: | |
push: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
version: | |
runs-on: ubuntu-latest | |
outputs: | |
local_tag: ${{steps.local.outputs.tag}} | |
remote_tag: ${{steps.remote.outputs.tag}} | |
is_latest_build_required: ${{steps.test.outputs.latest}} | |
steps: | |
- name: Get remote version | |
id: remote | |
run: | | |
git clone https://github.com/Jigsaw-Code/outline-server.git outline-server | |
cd outline-server | |
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT | |
- name: Get local release | |
id: local | |
run: | | |
echo "tag=$(curl -sL "https://api.github.com/repos/${{github.repository}}/releases" | jq -r '[.[] | select(.name | startswith("latest-"))] | sort_by(.published_at)[-1].name')" >> $GITHUB_OUTPUT | |
- name: Test | |
id: test | |
run: | | |
if [[ "latest-${{steps.remote.outputs.tag}}" != "${{steps.local.outputs.tag}}" ]]; | |
then | |
echo "latest=true" >> $GITHUB_OUTPUT | |
fi | |
build_master: | |
needs: [version] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v1 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: all | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.repository_owner}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Build and push | |
run: | | |
bash ./build.sh "${{env.ARCH}}" "${{env.PACKAGE_NAME}}:master" "master" | |
build_latest: | |
needs: [version] | |
runs-on: ubuntu-20.04 | |
if: needs.version.outputs.is_latest_build_required == 'true' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v1 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: all | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.repository_owner}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Build and push | |
run: | | |
bash ./build.sh "${{env.ARCH}}" "${{env.PACKAGE_NAME}}:latest" "${{needs.version.outputs.remote_tag}}" | |
- name: Conditional release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
tag_name: "latest-${{needs.version.outputs.remote_tag}}" | |
release_name: "latest-${{needs.version.outputs.remote_tag}}" | |
body: | | |
This release is for identification use of CI script. | |
Please, read README to deploy this package. | |
draft: false | |
prerelease: false |