Skip to content

Commit

Permalink
migrate to github
Browse files Browse the repository at this point in the history
  • Loading branch information
aine-etke committed Aug 20, 2024
1 parent e0e0d53 commit 517c545
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI (main and tags)
on:
push:
branches: [ "main" ]
env:
APP_VERSION: v1.11.74
BUNNY_UPLOAD_VERSION: v0.1.0
permissions:
checks: write
contents: write
packages: write
pull-requests: read
jobs:
build-publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
type=raw,value=${{ env.APP_VERSION }},enable=${{ github.ref_name == 'main' }}
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ env.APP_VERSION }}
build-deploy:
name: Build and Release
needs: build-publish
runs-on: ubuntu-latest
container: ghcr.io/${{ github.repository }}:${{ env.APP_VERSION }}
steps:
- uses: actions/checkout@v4
- name: Configure
run: |
cp ./config.json /app/config.json
mv /app ./public
- name: Upload
run: |
wget -O bunny-upload.tar.gz https://github.com/etkecc/bunny-upload/releases/download/${{ env.BUNNY_UPLOAD_VERSION }}/bunny-upload_Linux_x86_64.tar.gz
tar -xzf bunny-upload.tar.gz
echo "${{ secrets.BUNNY_CONFIG }}" > bunny-config.yaml
./bunny-upload -c bunny-config.yaml

0 comments on commit 517c545

Please sign in to comment.