Check & Build Image #6
This file contains hidden or 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: Check & Build Image | |
| on: | |
| workflow_dispatch: # Allows manual execution | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Connect to network | |
| uses: tailscale/github-action@v3 | |
| with: | |
| authkey: ${{ secrets.TAILSCALE_KEY }} | |
| #oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
| #oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
| tags: tag:ci | |
| version: latest | |
| args: "--login-server ${{ secrets.TAILSCALE_LOGIN_SERVER }}" | |
| hostname: "github-ci" | |
| - name: Test curl to registry server | |
| uses: jtalk/url-health-check-action@v4 | |
| with: | |
| url: https://${{ secrets.REGISTRY_SERVER }} | |
| max-attempts: 2 | |
| retry-delay: 2s | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU for multi-architecture | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.REGISTRY_SERVER }} | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build and push multi-architecture image | |
| run: | | |
| docker buildx build \ | |
| --platform linux/amd64,linux/arm64 \ | |
| --push \ | |
| -t ${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_USER }}/bitwarden-secure-sync:latest . | |