Skip to content

cd: added k8s deployment #10

cd: added k8s deployment

cd: added k8s deployment #10

Workflow file for this run

name: CI
on:
push:
branches:
- main
jobs:
build-and-push:
name: Build and Push
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Run tests
run: go test
- name: Generate SHA
id: generate_sha
run: |
SHA=$(echo $GITHUB_SHA | head -c7)
echo "sha=$SHA" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/nlw-api-journey:${{ steps.generate_sha.outputs.sha }}
${{ secrets.DOCKERHUB_USERNAME }}/nlw-api-journey:latest