This commit is contained in:
platane
2022-03-24 12:21:27 +01:00
parent 909a9c7fce
commit 7ba88d1fbd
3 changed files with 14 additions and 9 deletions

View File

@@ -32,7 +32,8 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v2
- name: build and publish the docker image
uses: docker/build-push-action@v2
id: docker-build
with:
push: true
@@ -40,7 +41,7 @@ jobs:
platane/snk:${{ github.sha }}
platane/snk:${{ github.event.inputs.version }}
- name: update action.yml
- name: update action.yml to point to the newly created docker image
run: |
sed -i "s/image: .*/image: docker:\/\/platane\/snk@${{ steps.docker-build.outputs.digest }}/" action.yml
@@ -49,19 +50,19 @@ jobs:
cache: yarn
node-version: 16
- name: bump version
run: yarn version --no-git-tag-version --new-version ${{ github.event.inputs.version }}
- name: build svg-only action
run: |
yarn install --frozen-lockfile
yarn build:action
mv packages/action/dist svg-only/dist
- name: bump package version
run: yarn version --no-git-tag-version --new-version ${{ github.event.inputs.version }}
- name: push new commit
uses: EndBug/add-and-commit@v7
with:
add: package.json svg-only action.yml
add: package.json svg-only/dist action.yml
message: 📦 ${{ github.event.inputs.version }}
tag: v${{ github.event.inputs.version }}

View File

@@ -20,7 +20,7 @@ Available as github action. Automatically generate a new image at the end of the
**github action**
```yaml
- uses: Platane/snk@master
- uses: Platane/snk@v1
with:
# github user name to read the contribution graph from (**required**)
# using action context var `github.repository_owner` or specified user
@@ -35,7 +35,9 @@ Available as github action. Automatically generate a new image at the end of the
svg_out_path: dist/github-snake.svg
```
> [example with cron job](https://github.com/Platane/Platane/blob/master/.github/workflows/main.yml#L24-L29)
[example with cron job](https://github.com/Platane/Platane/blob/master/.github/workflows/main.yml#L24-L29)
If you are only interested in generating a svg, you can use this other faster action: `uses: Platane/snk/svg-only@v1`
**interactive demo**

View File

@@ -5,7 +5,9 @@
"@actions/core": "1.6.0",
"@snk/gif-creator": "1.0.0",
"@snk/github-user-contribution": "1.0.0",
"@snk/svg-creator": "1.0.0"
"@snk/solver": "1.0.0",
"@snk/svg-creator": "1.0.0",
"@snk/types": "1.0.0"
},
"devDependencies": {
"@zeit/ncc": "0.22.3",