Skip to content

Instantly share code, notes, and snippets.

@alistaircol
Last active December 16, 2020 12:21
Show Gist options
  • Save alistaircol/bc5fcc9f0cbd82c90387f338a8000c1d to your computer and use it in GitHub Desktop.
Save alistaircol/bc5fcc9f0cbd82c90387f338a8000c1d to your computer and use it in GitHub Desktop.
github-action-php-tcpdf-build-release-on-tag
name: 'Build & Release'
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
env:
NAME: ${{ secrets.NAME }}
ADDRESS: ${{ secrets.ADDRESS }}
PHONE_OR_EMAIL: ${{ secrets.PHONE_OR_EMAIL }}
WEBSITE: ${{ secrets.WEBSITE }}
- name: 'Composer'
run: |
composer install
- name: 'Build'
run: |
php src/index.php
- name: 'Create Release'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ 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:
# 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
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./resume.pdf
asset_name: cv.pdf
asset_content_type: application/pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment