Merge pull request #6 from terminalx-resonite/main #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build and Push Domain Server Images | |
on: | |
push: | |
branches: | |
- main | |
- testing | |
jobs: | |
build-and-push: | |
runs-on: | |
- self-hosted | |
- linux | |
- podman | |
- docker | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/#-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Docker Hub Container Registry | |
uses: docker/#-action@v3 | |
with: | |
registry: docker.io | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build server runtime with compiled binaries | |
run: > | |
podman build -t ghcr.io/${{ github.repository }}/domain-server-builder:latest -f ./Dockerfile.build . | |
podman push ghcr.io/${{ github.repository }}/domain-server-builder:latest | |
podman build -t ghcr.io/${{ github.repository }}/domain-server:latest -f ./Dockerfile.runtime . | |
podman push ghcr.io/${{ github.repository }}/domain-server:latest | |
- name: Tag and push to Docker Hub | |
run: > | |
podman tag ghcr.io/${{ github.repository }}/domain-server:latest docker.io/${{ secrets.DOCKERHUB_USERNAME }}/domain-server:latest | |
podman push docker.io/${{ secrets.DOCKERHUB_USERNAME }}/domain-server:latest | |
- name: Clean up | |
run: > | |
podman system prune | |