chore: update releases [ci skip]
This commit is contained in:
@@ -49,9 +49,10 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
name: Semantic Release
|
name: Semantic Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
||||||
|
IMAGE_NAME: ${{ inputs.image-name }}
|
||||||
|
REGISTRY_URL: ${{ inputs.registry-url }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -73,7 +74,26 @@ jobs:
|
|||||||
GIT_AUTHOR_EMAIL: "ci@etwo.dev"
|
GIT_AUTHOR_EMAIL: "ci@etwo.dev"
|
||||||
GIT_COMMITTER_NAME: "CI Bot"
|
GIT_COMMITTER_NAME: "CI Bot"
|
||||||
GIT_COMMITTER_EMAIL: "ci@etwo.dev"
|
GIT_COMMITTER_EMAIL: "ci@etwo.dev"
|
||||||
IMAGE_NAME: ${{ inputs.image-name }}
|
|
||||||
|
- name: Install yq
|
||||||
|
run: |
|
||||||
|
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
|
||||||
|
chmod +x /usr/bin/yq
|
||||||
|
|
||||||
|
- name: Update docker-compose.yml
|
||||||
|
run: |
|
||||||
|
VERSION=$(cat .release-version)
|
||||||
|
echo "Updating docker-compose.yml with image ${IMAGE_NAME}:${VERSION}"
|
||||||
|
yq -i ".services.\"${IMAGE_NAME}\".image = \"${REGISTRY_URL}/${IMAGE_NAME}:${VERSION}\"" docker-compose.yml
|
||||||
|
|
||||||
|
- name: Commit and push docker-compose.yml changes
|
||||||
|
run: |
|
||||||
|
VERSION=$(cat .release-version)
|
||||||
|
git config user.name "CI Bot"
|
||||||
|
git config user.email "ci@etwo.dev"
|
||||||
|
git add docker-compose.yml
|
||||||
|
git commit -m "chore(release): update compose to ${VERSION} [skip ci]" || echo "No changes to commit"
|
||||||
|
git push origin HEAD
|
||||||
|
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
# Build and Push Docker Image
|
# Build and Push Docker Image
|
||||||
@@ -81,6 +101,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Build and Push Docker Image
|
name: Build and Push Docker Image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: release
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: ${{ inputs.image-name }}
|
IMAGE_NAME: ${{ inputs.image-name }}
|
||||||
REGISTRY_URL: ${{ inputs.registry-url }}
|
REGISTRY_URL: ${{ inputs.registry-url }}
|
||||||
@@ -96,7 +117,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(cat .release-version 2>/dev/null || echo "latest")
|
VERSION=$(cat .release-version || echo "latest")
|
||||||
echo "Building docker image with tag $VERSION"
|
echo "Building docker image with tag $VERSION"
|
||||||
docker build -t $REGISTRY_URL/${IMAGE_NAME}:$VERSION .
|
docker build -t $REGISTRY_URL/${IMAGE_NAME}:$VERSION .
|
||||||
docker push $REGISTRY_URL/${IMAGE_NAME}:$VERSION
|
docker push $REGISTRY_URL/${IMAGE_NAME}:$VERSION
|
||||||
@@ -107,13 +128,13 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
name: Deploy to Portainer
|
name: Deploy to Portainer
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: release
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Deploy stack via Portainer API
|
- name: Deploy stack via Portainer API
|
||||||
uses: actions/portable@v1
|
uses: https://git.etwo.dev/actions/portable@v1
|
||||||
with:
|
with:
|
||||||
portainer-url: ${{ inputs.portainer-url }}
|
portainer-url: ${{ inputs.portainer-url }}
|
||||||
portainer-token: ${{ secrets.PORTAINER_TOKEN }}
|
portainer-token: ${{ secrets.PORTAINER_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user