Skip to content

Commit 606162f

Browse files
committed
Merge branch 'main' of github.com:restsend/restsend-rs
2 parents ecfca09 + 4580f4c commit 606162f

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Log in to Container registry
20+
if: github.event_name == 'push'
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Build Docker image
28+
run: |
29+
tag=$(date +%Y%m%d)
30+
if [[ "${{ github.event.head_commit.message }}" =~ \[latest\] ]]; then
31+
tag=latest
32+
fi
33+
docker build . --tag ghcr.io/restsend/restsend:$tag
34+
35+
- name: Push Docker image
36+
if: github.event_name == 'push'
37+
run: |
38+
tag=$(date +%Y%m%d)
39+
if [[ "${{ github.event.head_commit.message }}" =~ \[latest\] ]]; then
40+
tag=latest
41+
docker push ghcr.io/restsend/restsend:$tag
42+
fi

0 commit comments

Comments
 (0)