diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml new file mode 100644 index 0000000..d56e202 --- /dev/null +++ b/.gitea/workflows/docker-build.yml @@ -0,0 +1,55 @@ +name: Build and Push Svelte Docker Image + +on: + push: + branches: [prod] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build Svelte app + run: npm run build + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Gitea Container Registry + uses: docker/login-action@v2 + with: + registry: git.vinylnostalgia.com + username: ${{ secrets.RUNNER_USERNAME }} + password: ${{ secrets.RUNNER_PASSWORD }} + + - name: Generate Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: git.vinylnostalgia.com/mo/ava + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file