Skip to content

Update dependency next-themes to ^0.3.0 #332

Update dependency next-themes to ^0.3.0

Update dependency next-themes to ^0.3.0 #332

Workflow file for this run

name: Backend CI/CD
on:
push:
paths:
- "backend/**"
- ".github/workflows/backend.yml"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
cache-dependency-path: "backend/go.sum"
go-version-file: "backend/go.mod"
- name: Install dependencies
working-directory: ./backend/cmd/api
run: go get .
- name: Test with the Go CLI
working-directory: ./backend
run: go test ./... -coverprofile=coverage.out
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./backend/coverage.out
build:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Test image and export
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile.prod
target: release
tags: release-image:latest
outputs: type=docker,dest=/tmp/release-image.tar
- name: Upload Test image artifact
uses: actions/upload-artifact@v4
with:
name: release-image-${{ github.sha }}
path: /tmp/release-image.tar
retention-days: 1
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: ["build", "test"]
steps:
- name: Download Release image artifact
uses: actions/download-artifact@v4
with:
name: release-image-${{ github.sha }}
path: /tmp
- name: Load Release image
run: |
docker load --input /tmp/release-image.tar
- name: Tag the image for Dockerhub
run: docker tag release-image:latest gwkline/full-stack-skeleton:backend-latest
- name: Set Release Version from Tag
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
# - name: New Relic Application Deployment Marker
# uses: newrelic/deployment-marker-action@v2.5.0
# with:
# apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
# guid: ${{ secrets.NEW_RELIC_DEPLOYMENT_ENTITY_GUID }}
# version: "${{ env.RELEASE_VERSION }}"
# user: "${{ github.actor }}"
- name: Login to Docker Registry
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Dockerhub
run: docker push gwkline/full-stack-skeleton:backend-latest