Last active
August 22, 2022 07:00
-
-
Save ssiva13/eeeef77ca1db2d55403671d14042204d to your computer and use it in GitHub Desktop.
This gist shows how to use ssh agent to run composer and npm install for packages from private repos in bitbucket through 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: SIMPLE ACTIONS | |
on: | |
pull_request: | |
branches: [ master, develop ] | |
jobs: | |
simple-job: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e | |
with: | |
php-version: '8.1' | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.PRIVATE_KEY }} | |
- name: 'SSH: TRUST HOSTS' | |
run: | | |
ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
- uses: actions/checkout@v3 | |
- name: Copy .env file | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: Install Compose Dependencies And Packages | |
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
- name: Install NPM Dependencies And Packages | |
run: npm install --silent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment