38 lines
1.0 KiB
YAML
38 lines
1.0 KiB
YAML
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to Gitea Container Registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: git.aykhans.me
|
|
username: ${{ secrets.ACCOUNT_USERNAME }}
|
|
password: ${{ secrets.ACCOUNT_TOKEN }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: git.aykhans.me/${{ github.repository }}:latest
|
|
|
|
- name: Create Package
|
|
env:
|
|
ACCOUNT_TOKEN: ${{ secrets.ACCOUNT_TOKEN }}
|
|
run: |
|
|
curl -X POST "https://git.aykhans.me/api/v1/packages/${{ github.repository_owner }}/docker/${{ github.repository_name }}/blobs/upload" \
|
|
-H "Authorization: token $ACCOUNT_TOKEN" \
|
|
-H "Content-Type: application/octet-stream" \
|
|
--data-binary "@Dockerfile"
|