fix cicd
This commit is contained in:
parent
b91858f8a5
commit
e26fcdbd74
3 changed files with 17 additions and 19 deletions
|
|
@ -48,11 +48,3 @@ jobs:
|
||||||
file: ./docker/Dockerfile
|
file: ./docker/Dockerfile
|
||||||
tags: ${{ env.CONTAINER_IMAGE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}:${{ env.IMAGE_VERSION }}
|
tags: ${{ env.CONTAINER_IMAGE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}:${{ env.IMAGE_VERSION }}
|
||||||
push: true
|
push: true
|
||||||
- name: Discord Notification
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
|
|
||||||
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
|
|
||||||
curl -H "Content-Type: application/json" -X POST \
|
|
||||||
-d "{\"embeds\":[{\"title\":\"$STATUS\",\"description\":\"Build Image: \`${{env.CONTAINER_IMAGE_NAME}}:${{env.IMAGE_VERSION}}\`\nBy: \`${{gitea.actor}}\`\",\"color\":$COLOR}]}" \
|
|
||||||
${{ env.DISCORD_WEBHOOK }}
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ jobs:
|
||||||
ca=["/etc/ssl/certs/ca-certificates.crt"]
|
ca=["/etc/ssl/certs/ca-certificates.crt"]
|
||||||
- name: Tag Version
|
- name: Tag Version
|
||||||
run: |
|
run: |
|
||||||
echo "IMAGE_VERSION=latest" >> $GITHUB_ENV
|
echo "IMAGE_VERSION=latest" >> $FORGEJO_ENV
|
||||||
- name: Login in to registry
|
- name: Login in to registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -55,11 +55,25 @@ jobs:
|
||||||
cd ~/repo
|
cd ~/repo
|
||||||
./replace-env.sh APP_CHECKIN "${{ env.IMAGE_VERSION }}"
|
./replace-env.sh APP_CHECKIN "${{ env.IMAGE_VERSION }}"
|
||||||
./deploy.sh hrms-checkin
|
./deploy.sh hrms-checkin
|
||||||
|
|
||||||
- name: Discord Notification
|
- name: Discord Notification
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
|
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
|
||||||
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
|
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
|
||||||
curl -H "Content-Type: application/json" -X POST \
|
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||||
-d "{\"embeds\":[{\"title\":\"$STATUS\",\"description\":\"Build & Deploy Image: \`${{env.CONTAINER_IMAGE_NAME}}:${{env.IMAGE_VERSION}}\`\nBy: \`${{gitea.actor}}\`\",\"color\":$COLOR}]}" \
|
curl -H "Content-Type: application/json" \
|
||||||
|
-X POST \
|
||||||
|
-d "{
|
||||||
|
\"embeds\": [{
|
||||||
|
\"title\": \"$STATUS\",
|
||||||
|
\"description\": \"**Build & Deploy:**\\n- Image: \`${{ env.CONTAINER_IMAGE_NAME }}\`\\n- Version: \`${{ env.IMAGE_VERSION }}\`\\n- Deployed by: \`${{ github.actor }}\`\",
|
||||||
|
\"color\": $COLOR,
|
||||||
|
\"footer\": {
|
||||||
|
\"text\": \"Release Notification\",
|
||||||
|
\"icon_url\": \"https://example.com/success-icon.png\"
|
||||||
|
},
|
||||||
|
\"timestamp\": \"$TIMESTAMP\"
|
||||||
|
}]
|
||||||
|
}" \
|
||||||
${{ env.DISCORD_WEBHOOK }}
|
${{ env.DISCORD_WEBHOOK }}
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,3 @@ jobs:
|
||||||
cd ~/repo
|
cd ~/repo
|
||||||
./replace-env.sh APP_CHECKIN "${{ inputs.version }}"
|
./replace-env.sh APP_CHECKIN "${{ inputs.version }}"
|
||||||
./deploy.sh hrms-checkin
|
./deploy.sh hrms-checkin
|
||||||
- name: Discord Notification
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
|
|
||||||
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
|
|
||||||
curl -H "Content-Type: application/json" -X POST \
|
|
||||||
-d "{\"embeds\":[{\"title\":\"$STATUS\",\"description\":\"Deploy Image: \`${{env.CONTAINER_IMAGE_NAME}}:${{env.IMAGE_VERSION}}\`\nBy: \`${{gitea.actor}}\`\",\"color\":$COLOR}]}" \
|
|
||||||
${{ env.DISCORD_WEBHOOK }}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue