Skip to content

feat: update deploy script #7

feat: update deploy script

feat: update deploy script #7

Workflow file for this run

name: Deploy
on:
pull_request:
branches:
- feature/mozart-deps
push:
branches:
- feature/mozart-deps
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set-up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Configure GitHub token for Composer
run: composer config --global github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
- name: Add private repository to Composer's global config
run: |
composer global config repositories.mozart '{"type": "vcs", "url": "https://github.com/dkjensen/mozart"}'
- name: Install Mozart globally
run: composer global require dkjensen/mozart:dev-master
- name: Build release
shell: bash
run: |
npm ci --no-optional
npm run plugin-zip
- name: Upload to File.io
id: upload_file
run: |
response=$(curl -F "file=@build/wc-cart-pdf.zip" https://file.io)
echo "Response: $response"
url=$(echo $response | jq -r '.link')
echo "::set-output name=file_url::$url"
- name: Email release with File.io link
uses: dawidd6/action-send-mail@v2
with:
server_address: smtp.resend.com
server_port: 465
username: resend
password: ${{ secrets.EMAIL_PASSWORD }}
from: David Jensen <[email protected]>
subject: New release of WC Cart PDF
body: |
A new release of WC Cart PDF has been published.
You can download the file from the following link: ${{ steps.upload_file.outputs.file_url }}
to: ${{ secrets.EMAIL }}