Some checks failed
Docker Build and Push / build-and-push (push) Has been cancelled
30 lines
1.1 KiB
YAML
30 lines
1.1 KiB
YAML
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 |