Skip to content

Commit

Permalink
chore: automate release & docker image publishing (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
digiz3d authored May 17, 2023
1 parent 5a65ae4 commit 7f3ae58
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release and publish
on:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release-please
with:
release-type: node
package-name: docker-web-recorder
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
get-release:
needs: release-please
if: ${{ needs.release-please.outputs.releases_created }}
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.get-last-release.outputs.result }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: get version
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
- id: get-last-release
name: Get last release
uses: actions/github-script@v6
with:
script: |
const { data } = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: `v${process.env.PACKAGE_VERSION}`
})
return data.id
publish-docker:
needs: get-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: get version
id: get_version
run: echo "package_version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: leandredaumont/docker-web-recorder:latest,leandredaumont/docker-web-recorder:${{steps.get_version.outputs.package_version}}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ docker build -t docker-web-recorder:latest .
## Record a file

```bash
docker run -v /absolute/path/to/your/recordings:/app/recordings --rm -e OUTPUT=video.mp4 -e URL=https://xxxxx.com/video/123456 -e DURATION=25 -it docker-web-recorder:latest
docker run --rm -v /absolute/path/to/your/recordings:/app/recordings -e OUTPUT=video.mp4 -e URL=https://xxxxx.com/video/123456 -e DURATION=25 -it docker-web-recorder:latest
```

## Make a livestream
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "docker-web-recorder",
"private": true,
"version": "0.0.1",
"description": "Docker container that can record web pages with sound",
"main": "src/index.ts",
Expand Down

0 comments on commit 7f3ae58

Please sign in to comment.