Skip to content

Commit

Permalink
Build versions and tag them
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Sep 20, 2020
1 parent 9488a8e commit 85004b6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/watch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Watch

on:
schedule:
- cron: '30 */4 * * *'
push: ~

jobs:
docker:
name: Push tagged docker image
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: master

- name: Update Dockerfile with latest version
id: fetch_version
run: |
last=$(curl -s https://packagist.org/packages/vimeo/psalm.json|jq '[.package.versions[]|select(.version|test("^\\d+\\.\\d+\\.\\d+$"))|.version]|max_by(.|[splits("[.]")]|map(tonumber))')
last=$(echo $last | tr -d '"')
echo "Last Psalm version is $last"
echo ::set-output name=last::$last
sed -i -re "s/require vimeo\/psalm/require vimeo\/psalm:$last/" Dockerfile
cat Dockerfile
- name: Docker login
run: echo '${{ secrets.DOCKER_PASSWORD }}' | docker login --username ${{ secrets.DOCKER_USERNAME }} --password-stdin

- name: Build images
run: docker build -t vimeo/psalm-github-actions:${{ steps.fetch_version.outputs.last }} .

- name: Publish
run: docker push vimeo/psalm-github-actions:${{ steps.fetch_version.outputs.last }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ADD https://github.com/vimeo/psalm/commits/master.atom /dev/null

RUN COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME="/composer" \
composer global require --prefer-dist --no-progress --dev vimeo/psalm
composer global require vimeo/psalm --prefer-dist --no-progress --dev

ENV PATH /composer/vendor/bin:${PATH}

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ jobs:
uses: docker://vimeo/psalm-github-actions

```

You can also specify a version (after 3.14.2).

```diff
- name: Psalm
- uses: docker://vimeo/psalm-github-actions
+ uses: docker://vimeo/psalm-github-actions:3.14.2
```

0 comments on commit 85004b6

Please sign in to comment.