update ci #16
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: Main | |
on: | |
push: | |
branches: | |
- "main" | |
- "demo" | |
permissions: | |
contents: read | |
pull-requests: write | |
env: | |
ENVIRONMENT_ID: 'development' | |
HUMCTL_VERSION: 0.24.0 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build and Push to Humanitec | |
id: build-push | |
uses: humanitec/build-push-to-humanitec@v1 | |
with: | |
humanitec-token: ${{ secrets.HUMANITEC_TOKEN }} | |
organization: ${{ vars.HUMANITEC_ORG }} | |
- name: Install humctl | |
run: | | |
wget https://github.com/humanitec/cli/releases/download/v${{ env.HUMCTL_VERSION }}/cli_${{ env.HUMCTL_VERSION }}_linux_amd64.tar.gz | |
tar -xvf cli_${{ env.HUMCTL_VERSION }}_linux_amd64.tar.gz | |
chmod +x humctl | |
mv humctl /usr/local/bin | |
- name: Run Score | |
run: | | |
if ! [ -f score.yaml ] | |
then | |
echo "no score file found, cannot deploy" | |
exit 1 | |
fi | |
humctl score deploy -f score.yaml \ | |
--image "${{ steps.build-push.outputs.image }}" \ | |
--wait \ | |
--token ${{ secrets.HUMANITEC_TOKEN }} \ | |
--org ${{ vars.HUMANITEC_ORG }} \ | |
--app ${{ vars.HUMANITEC_APP }} \ | |
--env ${{ env.ENVIRONMENT_ID }} |