Merge pull request #9 from valtlfelipe/feat/docker-image #3
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: go-deploy | |
on: | |
push: | |
branches: ["main"] | |
permissions: | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.22" | |
- name: Login to GitHub Container Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build Docker image | |
run: docker build . --tag ghcr.io/valtlfelipe/go-api:latest | |
- name: Push Docker image | |
run: docker build . --tag ghcr.io/valtlfelipe/go-api:latest |