-
Notifications
You must be signed in to change notification settings - Fork 37
37 lines (33 loc) · 854 Bytes
/
docker-image.yml
File metadata and controls
37 lines (33 loc) · 854 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
33
34
35
36
37
name: Docker Image CI
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'container-example/**'
pull_request:
branches: [main]
paths:
- 'container-example/**'
defaults:
run:
working-directory: container-example
jobs:
build:
environment: docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: container-example
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/static-site:latest
${{ secrets.DOCKER_USERNAME }}/static-site:${{ github.sha }}