Merge pull request #24 from gelzis/dependabot/npm_and_yarn/babel/trav… #154
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy | |
on: | |
push: | |
branches: | |
- master | |
- v3 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set variables | |
id: vars | |
run: | | |
echo ::set-output name=docker_image::docker.pkg.github.com/${{ github.repository }}/master:$(git rev-parse --short=7 ${{ github.sha }}) | |
- name: Build docker image | |
run: | | |
docker build . --file Dockerfile --tag ${{ steps.vars.outputs.docker_image }} | |
- name: Login to registry | |
run: | | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com --username ${{ github.actor }} --password-stdin | |
- name: Push docker image | |
run: | | |
docker push ${{ steps.vars.outputs.docker_image }} | |
- name: Deploy | |
run: | | |
jq -n \ | |
--arg msg "$(git log --format=%B -n 1)" \ | |
'{"repository":"${{ github.repository }}","dockerImage":"${{ steps.vars.outputs.docker_image }}","branch":"${{ github.ref }}","commitMessage":$msg}' | \ | |
curl -s --fail -X POST -H 'Content-Type: application/json' -H 'Authorization: Basic ${{ secrets.deployToken }}' -d@- https://galleon.pekle.lv/deploy |