feat(ci/cd): Implemented simple package publishing to registry
Some checks failed
Build and Publish Docker Image / deploy (push) Failing after 1m1s
Some checks failed
Build and Publish Docker Image / deploy (push) Failing after 1m1s
This commit is contained in:
45
.gitea/workflows/publish.yml
Normal file
45
.gitea/workflows/publish.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Build and Publish Docker Image
|
||||
run-name: Publishing ${{ gitea.ref_name }}
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: false
|
||||
|
||||
- name: Run Tests
|
||||
run: go test ./...
|
||||
|
||||
- name: Install Docker
|
||||
run: curl -fsSL https://get.docker.com | sh
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
docker build \
|
||||
-t tea.chunkbyte.com/kato/WarpBox:${{ gitea.ref_name }} \
|
||||
-t tea.chunkbyte.com/kato/WarpBox:latest \
|
||||
.
|
||||
|
||||
- name: Login to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: tea.chunkbyte.com
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Push Docker Image
|
||||
run: |
|
||||
docker push tea.chunkbyte.com/kato/WarpBox:${{ gitea.ref_name }}
|
||||
docker push tea.chunkbyte.com/kato/WarpBox:latest
|
||||
Reference in New Issue
Block a user