This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
-
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
Showing
1 changed file
with
66 additions
and
5 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 |
---|---|---|
|
@@ -8,20 +8,81 @@ concurrency: | |
group: cd-${{ github.ref }} | ||
|
||
jobs: | ||
version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Get tag | ||
id: version-tag | ||
uses: nationalarchives/ds-docker-actions/.github/actions/get-version-tag@main | ||
outputs: | ||
version: ${{ steps.version-tag.outputs.version-tag }} | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- version | ||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create version tag | ||
id: version-tag | ||
uses: nationalarchives/ds-docker-actions/.github/actions/get-version-tag@main | ||
- name: Build Docker image | ||
uses: nationalarchives/ds-docker-actions/.github/actions/docker-build@main | ||
with: | ||
version: ${{ steps.version-tag.outputs.version-tag }} | ||
version: ${{ needs.version.outputs.version }} | ||
latest: ${{ github.ref == 'refs/heads/proof-of-concept' }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
docker-image-name: ${{ vars.DOCKER_IMAGE_NAME }} | ||
docker-image-name: ${{ vars.DOCKER_IMAGE_NAME }} | ||
|
||
update-proof-of-concept: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
- version | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: nationalarchives/ds-etna-deployments-proof-of-concept | ||
ref: main | ||
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }} | ||
- name: Set up git config | ||
run: | | ||
git config user.name "ds-etna-search" | ||
git config user.email "<>" | ||
- name: Install jq | ||
run: sudo apt-get install jq | ||
- name: Update config | ||
run: jq --indent 4 '(.services.search.version|="${{ needs.version.outputs.version }}")' config-aws-develop.json > tmp.$$.json && mv tmp.$$.json config-aws-develop.json | ||
- name: Push new version | ||
run: | | ||
git add config-aws-develop.json | ||
git commit -m "Update search to v${{ needs.version.outputs.version }}" | ||
git push origin main | ||
update-dblclk: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
- version | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: nationalarchives/ds-etna | ||
ref: proof-of-concept | ||
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }} | ||
- name: Set up git config | ||
run: | | ||
git config user.name "ds-etna-search" | ||
git config user.email "<>" | ||
- name: Install yq | ||
uses: dcarbone/[email protected] | ||
- name: Update config | ||
run: yq '(.services.search.image|="ghcr.io/${{ github.repository_owner }}/${{ vars.DOCKER_IMAGE_NAME }}:${{ needs.version.outputs.version }}")' docker-compose.yml > tmp.$$.yml && mv tmp.$$.yml docker-compose.yml | ||
- name: Push new version | ||
run: | | ||
git add docker-compose.yml | ||
git commit -m "Update search to v${{ needs.version.outputs.version }}" | ||
git push origin proof-of-concept |