chore(deps): update dependency rector/rector to v0.17.7 (#590) #295
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: "Build and deploy 🚀" | |
on: | |
workflow_dispatch: ~ | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: 'ubuntu-latest' | |
env: | |
APP_ENV: prod | |
BRANCH: ${{ github.ref_name }} | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v3 | |
- name: "Install PHP with extensions" | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: "none" | |
extensions: intl, ctype, iconv | |
php-version: 8.2 | |
tools: composer | |
- name: "Composer install" | |
run: composer install --no-dev --optimize-autoloader --no-interaction | |
- name: "Compile CSS and Javascript" | |
run: | | |
yarn install | |
yarn build | |
- name: "Create deployment artifact" | |
uses: thedoctor0/zip-release@master | |
with: | |
type: 'zip' | |
filename: app-latest.zip | |
exclusions: '*.git* /*node_modules/* /*tests/* /*var/cache/*' | |
- name: "Store artifact for distribution" | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
source: app-latest.zip | |
target: "$HOME/build" | |
deploy: | |
runs-on: 'ubuntu-latest' | |
environment: | |
name: production | |
url: https://jobbsy.dev | |
needs: ['build'] | |
env: | |
ANSIBLE_VAULT_PASSWORD: ${{ secrets.ANSIBLE_VAULT_PASSWORD }} | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v3 | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- name: Adding Known Hosts | |
run: "ssh-keyscan -H -p ${{ secrets.SSH_PORT }} ${{ secrets.HOST }} >> ~/.ssh/known_hosts" | |
- name: "Setup Ansible" | |
run: | | |
echo "$ANSIBLE_VAULT_PASSWORD" > .ansible/.vault_pass | |
ansible-galaxy install -r .ansible/requirements.yml | |
- name: "Deploy" | |
run: make deploy |