Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishumanitec committed May 30, 2024
1 parent 13e121f commit deda831
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/close_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
types:
- closed
env:
HUMCTL_VERSION: 0.13.3
HUMCTL_VERSION: 0.24.0
jobs:
cleanup:
runs-on: ubuntu-latest
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
pull-requests: write
env:
ENVIRONMENT_ID: 'development'
SCORE_HUMANITEC_VERSION: 0.10.0
HUMCTL_VERSION: 0.24.0
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -21,24 +21,23 @@ jobs:
with:
humanitec-token: ${{ secrets.HUMANITEC_TOKEN }}
organization: ${{ vars.HUMANITEC_ORG }}
- name: Install score-humanitec
- name: Install humctl
run: |
wget https://github.com/score-spec/score-humanitec/releases/download/${{ env.SCORE_HUMANITEC_VERSION }}/score-humanitec_${{ env.SCORE_HUMANITEC_VERSION }}_linux_amd64.tar.gz
tar -xvf score-humanitec_${{ env.SCORE_HUMANITEC_VERSION }}_linux_amd64.tar.gz
chmod +x score-humanitec
mv score-humanitec /usr/local/bin
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
score-humanitec delta \
--image "${{ steps.build-push.outputs.image }}" \
--retry \
--deploy \
--token ${{ secrets.HUMANITEC_TOKEN }} \
--org ${{ vars.HUMANITEC_ORG }} \
--app ${{ vars.HUMANITEC_APP }} \
--env ${{ env.ENVIRONMENT_ID }} > score_output.json
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 }}
34 changes: 8 additions & 26 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ permissions:
env:
BASE_ENVIRONMENT: 'development'
ENVIRONMENT_TYPE: 'ephemeral'
SCORE_HUMANITEC_VERSION: 0.10.0
HUMCTL_VERSION: 0.13.3
HUMCTL_VERSION: 0.24.0
ENVIRONMENT_ID: pr-${{ github.event.number }}
ENVIRONMENT_NAME: PR-${{ github.event.number }}
jobs:
Expand Down Expand Up @@ -47,27 +46,20 @@ jobs:
--token ${{ secrets.HUMANITEC_TOKEN }} \
--org ${{ vars.HUMANITEC_ORG }} \
--app ${{ vars.HUMANITEC_APP }}
- name: Install score-humanitec
run: |
wget https://github.com/score-spec/score-humanitec/releases/download/${{ env.SCORE_HUMANITEC_VERSION }}/score-humanitec_${{ env.SCORE_HUMANITEC_VERSION }}_linux_amd64.tar.gz
tar -xvf score-humanitec_${{ env.SCORE_HUMANITEC_VERSION }}_linux_amd64.tar.gz
chmod +x score-humanitec
mv score-humanitec /usr/local/bin
- name: Run Score
run: |
if ! [ -f score.yaml ]
then
echo "no score file found, cannot deploy"
exit 1
fi
score-humanitec delta \
--image "${{ steps.build-push.outputs.image }}" \
--retry \
--deploy \
--token ${{ secrets.HUMANITEC_TOKEN }} \
--org ${{ vars.HUMANITEC_ORG }} \
--app ${{ vars.HUMANITEC_APP }} \
--env ${{ env.ENVIRONMENT_ID }} > score_output.json
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 }}
- name: Wait for deployment
run: |
sleep 1
Expand Down Expand Up @@ -112,16 +104,6 @@ jobs:
echo "$DOMAINS" >> pr_message.txt
echo "" >> pr_message.txt
echo "<details><summary>Score Output</summary>" >> pr_message.txt
echo "" >> pr_message.txt
echo "### Score Output:" >> pr_message.txt
echo '```json' >> pr_message.txt
echo "" >> pr_message.txt
cat score_output.json >> pr_message.txt
echo "" >> pr_message.txt
echo '```' >> pr_message.txt
echo "" >> pr_message.txt
echo "</details>" >> pr_message.txt
cat pr_message.txt
- name: Comment PR
Expand Down
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

1 change: 1 addition & 0 deletions score.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ service:
resources:
jotd-dns:
type: dns
id: app-dns
jotd-route:
type: route
params:
Expand Down

0 comments on commit deda831

Please sign in to comment.