Kubernetes Operator that creates Service Endpoints from Secrets
1name: Build and Push Docker Image
2
3on:
4 push:
5 branches:
6 - main
7 paths-ignore:
8 - "charts/**"
9 - ".github/**"
10 pull_request:
11 branches:
12 - main
13 workflow_dispatch:
14
15jobs:
16 build:
17 runs-on: ubuntu-latest
18
19 steps:
20 - name: Checkout code
21 uses: actions/checkout@v4
22
23 - name: Set up QEMU
24 uses: docker/setup-qemu-action@v3
25 with:
26 platforms: all
27
28 - name: Set up Docker Buildx
29 uses: docker/setup-buildx-action@v3
30
31 - name: Log in to GitHub Container Registry
32 uses: docker/login-action@v3
33 with:
34 registry: ghcr.io
35 username: ${{ github.actor }}
36 password: ${{ secrets.GITHUB_TOKEN }}
37
38 - name: Extract metadata
39 id: meta
40 uses: docker/metadata-action@v5
41 with:
42 images: ghcr.io/${{ github.repository }}
43
44 - name: Build and push Docker image
45 id: docker_build
46 uses: docker/build-push-action@v6
47 with:
48 push: true
49 file: ./Dockerfile
50 platforms: linux/amd64,linux/arm64
51 tags: |
52 ghcr.io/${{ github.repository }}:latest
53 ghcr.io/${{ github.repository }}:${{ github.sha }}
54 annotations: |
55 "org.opencontainers.image.description=A simple Go application for image uploading."
56
57 - name: Image digest
58 run: echo "Image pushed with digest ${{ steps.docker_build.outputs.digest }}"