-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (24 loc) · 821 Bytes
/
Copy pathaction.yml
File metadata and controls
32 lines (24 loc) · 821 Bytes
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
name: CI With GitHub Actions
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout app
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Build and Push Docker image
env:
REPOSITORY: ci
IMAGE_TAG: latest
run: |
docker build -t ${{secrets.DOCKERHUB_USERNAME}}/$REPOSITORY:$IMAGE_TAG .
docker push ${{secrets.DOCKERHUB_USERNAME}}/$REPOSITORY:$IMAGE_TAG