diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d38ffe7..53aebb9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,36 +15,50 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get commit sha run: echo "COMMIT_SHA=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1 + uses: google-github-actions/auth@v2 with: token_format: access_token workload_identity_provider: ${{ secrets.IDENTITY_PROVIDER }} service_account: ${{ secrets.SERVICE_ACCOUNT }} - name: Login to Artifact Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ secrets.ARTIFACT_REGISTRY }} username: oauth2accesstoken password: ${{ steps.auth.outputs.access_token }} + - name: Add SSH key + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + mkdir -p ~/.ssh + ssh-keyscan -p ${{ secrets.ARM_NODE_PORT }} -H ${{ secrets.ARM_NODE_ADDR }} >> ~/.ssh/known_hosts + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + echo "${{ secrets.SSH_PRIVATE_KEY }}" | ssh-add - - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock with: - platforms: linux/amd64,linux/arm64 + endpoint: unix:///var/run/docker.sock + platforms: linux/amd64 + append: | + - endpoint: ssh://${{ secrets.ARM_NODE_USER }}@${{ secrets.ARM_NODE_ADDR }}:${{ secrets.ARM_NODE_PORT }} + platforms: linux/arm64 - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ secrets.ARTIFACT_REGISTRY }}/libnare/${{ github.event.repository.name }}/${{ github.ref_name }} - name: Build and Push env: IMAGE_TAG: ${{ github.sha }} - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: . push: true