Skip to content

Commit 3774600

Browse files
authored
👷 Add CI with GitHub actions (#15)
1 parent 267da49 commit 3774600

File tree

6 files changed

+70
-19
lines changed

6 files changed

+70
-19
lines changed

.github/workflows/deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Deploy Image
14+
run: bash scripts/build-push.sh
15+
env:
16+
NAME: latest
17+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
18+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

.github/workflows/issue-manager.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Issue Manager
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
issue_comment:
7+
types:
8+
- created
9+
- edited
10+
issues:
11+
types:
12+
- labeled
13+
14+
jobs:
15+
issue-manager:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: tiangolo/issue-manager@0.3.0
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
config: >
22+
{
23+
"answered": {
24+
"message": "Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues."
25+
}
26+
}

.github/workflows/main.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

scripts/build-push.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
use_tag="tiangolo/nginx-rtmp:$NAME"
6+
use_dated_tag="${use_tag}-$(date -I)"
7+
8+
bash scripts/build.sh
9+
10+
docker tag "$use_tag" "$use_dated_tag"
11+
12+
bash scripts/docker-login.sh
13+
14+
docker push "$use_tag"
15+
docker push "$use_dated_tag"

scripts/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
use_tag="tiangolo/nginx-rtmp:$NAME"
5+
6+
docker build -t "$use_tag" .

scripts/docker-login.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

0 commit comments

Comments
 (0)