-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.12 KB
/
ci.yml
File metadata and controls
49 lines (43 loc) · 1.12 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
name: Build and Tag Image
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *" # once every 24 hours (UTC)
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
pull-requests: write
repository-projects: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set timestamp tag
id: tag
run: |
TAG=$(date +"%Y%m%d_%H%M%S")
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
IMAGE=ghcr.io/stratos-linux/stratos-base
docker build \
-t $IMAGE:${TAG} \
-t $IMAGE:latest \
.
# ghcr.io/${{ github.repository }}
- name: Push Docker image
run: |
IMAGE=ghcr.io/stratos-linux/stratos-base
docker push $IMAGE:${TAG}
docker push $IMAGE:latest