mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 00:22:14 +11:00
41 lines
1.3 KiB
YAML
41 lines
1.3 KiB
YAML
name: Build
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
release:
|
|
name: Push Docker image to GitHub Packages
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
steps:
|
|
- name: Checkout the repo
|
|
uses: actions/checkout@v2
|
|
- name: Login to GitHub Docker Registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: docker.pkg.github.com
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Format repository
|
|
run: |
|
|
echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
|
- name: Build container image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
tags: |
|
|
docker.pkg.github.com/${{ env.IMAGE_REPOSITORY }}/ccash:${{ github.sha }}
|
|
docker.pkg.github.com/${{ env.IMAGE_REPOSITORY }}/ccash:latest
|
|
trigger-deploy:
|
|
needs: release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: |
|
|
curl -X POST \
|
|
-H 'Accept: application/vnd.github.v3+json' \
|
|
-H 'Authorization: Bearer ${{ secrets.CCASH_DEPLOY_TOKEN }}' \
|
|
https://api.github.com/repos/${{ github.repository }}/actions/workflows/deploy.yaml/dispatches \
|
|
-d '{"ref":"main"}'
|