End-to-end CI/CD lab automating Go application builds through Docker and GitHub Actions, integrated with GCP Artifact Registry.
Built reproducible, production-style pipelines — from local build → tag → push → deploy — and fully documented four real debugging cycles (auth, build, tag, and workflow errors).
📦 100% reproducible builds · 🔁 Automated deploys via GitHub Actions · 🧩 Validated artifact storage in GCP
All commands should be run using bash.
This project demonstrates a complete CI/CD workflow:
- Go app — simple program that outputs your name, date, and time.
- Dockerized container — validated locally with
docker ps -a. - Artifact Registry integration — authenticated and pushed via
gcloud.
Please note, time returned is in UTC. If running locally, will default to PDT, this can easily be changed to the timezone of your choice if desired in the code.
├── .github/
└── workflows/
├── README.md
└── go-dockerimage-pipeline.yaml
├── Deployment
├── Docs
└── OPERATIONS_LOG.md
├── Dockerfile
├── README.md
└── utc-time-date.go
- Real-world CI/CD pipeline for a containerized Go app.
- Hands-on use of GitHub Actions, Docker, and Google Cloud.
- Clean, reproducible workflow anyone can perform.
| Layer | Tool |
|---|---|
| Language | Go |
| Containerization | Docker |
| CI/CD | GitHub Actions |
| Cloud | Google Cloud Platform (Artifact Registry) |
- Docker
- Go
- Google Cloud SDK
- A Google Cloud project with an Artifact Registry
git clone https://github.com/justin-sniesak/go-docker-githubactions-pipeline.git
docker build -t utcTimeDate:latest .
docker run utcTimeDate
Verify output:
Hello, the date is 10/11/2025, and the time is 07:45 PM.
3️⃣ Authenticate with Google Cloud, create the artifact repo serviceaccount, attach the artifact registry IAM policy binding to the service account, create the API key, then connect your GitHub repo to your GCP project
gcloud auth configure-docker
gcloud iam service-accounts create github-actions-sa \ --display-name="GitHub Actions Service Account"
gcloud projects add-iam-policy-binding <your-project> --member="serviceAccount:github-actions-sa@<your-project>.iam.gserviceaccount.com" --role="roles/artifactregistry.writer"
gcloud iam service-accounts keys create key.json \ --iam-account=github-actions-sa@<your-project>.iam.gserviceaccount.com
cat key.json
GitHub repo -> Settings -> Secrets and Variables -> New repository secret -> paste the ENTIRE JSON key file from the previous step and save
docker tag gotime:latest us-west1-docker.pkg.dev/<your-project>/<repo-name>/utcTimeDate:latest
docker push us-west1-docker.pkg.dev/<your-project>/<repo-name>/utcTimeDate:latest
Builds Docker image
Outputs current time and date in the pipeline log
Run docker run --rm utcTimeDate
docker run --rm utcTimeDate
shell: /usr/bin/bash -e {0}
Hello, the date is 10/12/2025, and the time is 06:10 AM.
Create, authenticate to and push Docker image to GCP Artifact Registry
CI/CD pipelines don’t have to be complex to be production-grade
Debugging is part of mastery — not failure
All screenshots included in repo.
Issue 1: GCP Authentication Failure
- Problem: Incorrect account was set as active, blocking Docker image push to Artifact Registry
- Solution: Switched to correct active account via
gcloud config set account
Issue 2: Docker Build Failure
- Problem: Dockerfile and Go code were not at root level, causing path errors
- Solution: Moved both files to root directory to resolve COPY instruction
Issue 3: Pipeline Failure
- Problem: Renamed code file but didn't update GitHub Actions YAML reference
- Solution: Updated workflow file to match new filename, build completed successfully (RC0)
Issue 4: Tag and Push to GCP Failure
- Problem: Build is failing when attempting to tag the built docker image prior to pushing to Artifact Repo in GCP.
- Solution: Added unit test job, tagged image earlier in build process, broke tag/push job into two different jobs
Justin Sniesak
Infrastructure Engineer | Cloud | Kubernetes | CI/CD | Go 📍 Seattle, WA