-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53bdb92
commit bede018
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"on": | ||
push: | ||
branches: | ||
- master | ||
name: Deploy to Porter | ||
jobs: | ||
porter-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
- name: Download Porter | ||
id: download_porter | ||
run: |2 | ||
name=$(curl -s https://api.github.com/repos/porter-dev/porter/releases/latest | grep "browser_download_url.*/porter_.*_Linux_x86_64\.zip" | cut -d ":" -f 2,3 | tr -d \") | ||
name=$(basename $name) | ||
curl -L https://github.com/porter-dev/porter/releases/latest/download/$name --output $name | ||
unzip -a $name | ||
rm $name | ||
chmod +x ./porter | ||
sudo mv ./porter /usr/local/bin/porter | ||
- name: Configure Porter | ||
id: configure_porter | ||
run: |2 | ||
sudo porter config set-host https://dashboard.getporter.dev | ||
sudo porter auth login --token ${{secrets.PORTER_TOKEN_1305}} | ||
sudo porter docker configure | ||
- name: Docker build, push | ||
id: docker_build_push | ||
run: |2 | ||
export $(echo "${{secrets.ENV_TEST_01PW}}" | xargs) | ||
echo "${{secrets.ENV_TEST_01PW}}" > ./env_porter | ||
sudo docker build . $(cat ./env_porter | awk 'NF' | sed 's@^@--build-arg @g' | paste -s -d " " -) --file ./Dockerfile -t registry.digitalocean.com/porter-poc/test-01pw-default:$(git rev-parse --short HEAD) | ||
sudo docker push registry.digitalocean.com/porter-poc/test-01pw-default:$(git rev-parse --short HEAD) | ||
- name: Deploy on Porter | ||
id: deploy_porter | ||
run: |2 | ||
curl -X POST "https://dashboard.getporter.dev/api/webhooks/deploy/${{secrets.WEBHOOK_TEST_01PW}}?commit=$(git rev-parse --short HEAD)" |