Add .gitea/workflows/docker.yml
Some checks failed
Docker Build and Push / build-and-push (push) Has been cancelled
Some checks failed
Docker Build and Push / build-and-push (push) Has been cancelled
This commit is contained in:
commit
0b9b62d835
30
.gitea/workflows/docker.yml
Normal file
30
.gitea/workflows/docker.yml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
name: Docker Build and Push
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'dev' # Trigger on dev branch pushes
|
||||||
|
- 'main' # Trigger on main branch pushes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Log in to Gitea Registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ vars.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
|
||||||
|
|
||||||
|
- name: Build and Push Dev Image (if on dev branch)
|
||||||
|
if: github.ref == 'refs/heads/dev'
|
||||||
|
run: |
|
||||||
|
docker build -t ${{ vars.REGISTRY_URL }}/${{ vars.REPO_OWNER }}/docker-freeswitch:dev .
|
||||||
|
docker push ${{ vars.REGISTRY_URL }}/${{ vars.REPO_OWNER }}/docker-freeswitch:dev
|
||||||
|
|
||||||
|
- name: Build and Push Prod Image (if on main branch)
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
run: |
|
||||||
|
docker build -t ${{ vars.REGISTRY_URL }}/${{ vars.REPO_OWNER }}/docker-freeswitch:latest .
|
||||||
|
docker push ${{ vars.REGISTRY_URL }}/${{ vars.REPO_OWNER }}/docker-freeswitch:latest
|
Loading…
Reference in New Issue
Block a user