-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 1.01 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: build and dockerize the application
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Because the .env file is not in the repository, we need to create it
# using the secrets.ENV_FILE secret
- name: Create env file
run: |
touch .env
echo "${{ secrets.ENV_FILE }}" > .env
- 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 # Continued from the build job
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
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/goanonpicdb-aws:latest