Last active
August 31, 2021 23:38
-
-
Save keviocastro/d15e0644795a53780c6c75c5230e1d36 to your computer and use it in GitHub Desktop.
konecty github actions
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: | |
- "/^\\d+\\.\\d+\\.\\d+$/" | |
- "/^\\d+\\.\\d+\\.\\d+(-alpha)$/" | |
- "/^\\d+\\.\\d+\\.\\d+(-beta\\.\\d+)$/" | |
- "/^\\d+\\.\\d+\\.\\d+(-dev\\.\\d+)$/" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v2 | |
- name: Use Node.js 12.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 12.x | |
- name: Cache node modules | |
id: cache-primes | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: | | |
node_modules | |
.meteor' | |
.npm' | |
.node-gyp' | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install | |
run: | | |
if [ ! -e "$HOME/.meteor/meteor" ]; then curl https://install.meteor.com | sed s/--progress-bar/-sL/g | |
| /bin/sh; fi | |
export PATH="$HOME/.meteor:$PATH" | |
- name: Script | |
run: | | |
meteor --version | |
meteor npm install | |
meteor build --server-only /tmp/build | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./tmp/build/Konecty.tar.gz | |
asset_name: Konecty.tar.gz | |
asset_content_type: application/zip | |
- name: After deploy | |
run: | | |
curl -H "Content-Type: application/json" \ | |
--data '{"source_type":"Tag","source_name":"'"$TRAVIS_TAG"'"}' \ | |
-X POST "https://hub.docker.com/api/build/v1/source/$DOCKERHUB_TOKEN/trigger/$DOCKERHUB_BUILD/call/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment