Bump github.com/microsoftgraph/msgraph-sdk-go from 1.37.0 to 1.38.0 (… #152
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 Docker Image | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.go' | |
- 'go.mod' | |
- 'go.sum' | |
- 'Dockerfile' | |
- '.github/workflows/**' | |
permissions: | |
contents: write | |
packages: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
ci: | |
name: Build and Push Docker Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache-dependency-path: 'go.sum' | |
- run: go version | |
- name: Test | |
run: | | |
go test -coverprofile=coverage.out ./... | |
go tool cover -html=coverage.out -o coverage.html | |
shell: bash | |
- name: Upload Test Coverage Report | |
uses: actions/upload-artifact@v4.3.2 | |
with: | |
name: coverage | |
path: coverage.html | |
compression-level: 0 | |
- name: Generate Swagger Docs | |
run: go run github.com/swaggo/swag/cmd/swag@latest init --outputTypes json --output . | |
shell: bash | |
- name: Push Swagger Docs | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git pull | |
git add . | |
# Check if there are changes | |
if git diff --staged --quiet; then | |
echo "No changes to commit." | |
else | |
git commit -m "Update Swagger Docs" | |
git push origin main | |
fi | |
shell: bash | |
- name: Build Go Application | |
env: | |
CGO_ENABLED: 0 | |
GOOS: linux | |
GOARCH: amd64 | |
run: go build -v -ldflags="-s -w" main.go | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# Login to GitHub Container Registry | |
- name: Registry Login | |
uses: docker/login-action@v3.1.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
logout: true | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64 | |
tags: ghcr.io/${{ github.actor }}/day-planner-gpt-data-portal/portal:latest | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |