Fix docker YML misuses #6
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 dockerize the application | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Build | |
run: go build -v . | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Login to Dockerhub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and release to DockerHub | |
env: | |
NAME: knightchaser # DockerHub account name | |
REPO: goanonpicdb-aws # DockerHub repository name | |
run: | | |
docker build --tag $REPO . | |
docker tag $REPO:latest $NAME/$REPO:latest | |
docker push $NAME/$REPO:latest |