add build workflows
All checks were successful
Main CI/CD / Build and push (push) Successful in 9m29s
All checks were successful
Main CI/CD / Build and push (push) Successful in 9m29s
This commit is contained in:
28
.gitea/workflows/build.yaml
Normal file
28
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Main CI/CD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
name: Build and push
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: registry.btwazure.com
|
||||||
|
username: ${{ secrets.HARBOR_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_PASSWORD }}
|
||||||
|
- name: Build & Push
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ secrets.REGISTRY }}
|
||||||
|
IMAGE_TAG: ${{gitea.sha}}
|
||||||
|
run: |
|
||||||
|
docker build --pull --no-cache=true --tag $REGISTRY --tag $REGISTRY:$IMAGE_TAG .
|
||||||
|
docker push $REGISTRY
|
||||||
|
docker push $REGISTRY:$IMAGE_TAG
|
||||||
|
docker rmi $(docker images -q $REGISTRY:$IMAGE_TAG) -f
|
||||||
Reference in New Issue
Block a user