Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Migrate visit count to mongo (duplicate) #1297

Migrate visit count to mongo (duplicate)

Migrate visit count to mongo (duplicate) #1297

name: Build
on: pull_request
jobs:
end2end:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
- uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
with:
current_version: ${{ steps.get-latest-tag.outputs.tag }}
level: patch
- name: "Set output"
run: echo "mix_drinks_backend_version=${{ steps.bump-semver.outputs.new_version }}-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: "Print output mix drinks backend version"
run: echo ${{ env.mix_drinks_backend_version }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
build-args: |
MIX_DRINKS_APP_VERSION=${{env.mix_drinks_backend_version}}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/mixdrinks:${{env.mix_drinks_backend_version}}
- name: Create docker compose prod file (set image)
shell: bash
run: |
sed -e 's,build: .,image: 'vovochkastelmashchuk/mixdrinks:${{env.mix_drinks_backend_version}}',g' < docker-compose.yml >> docker-compose-prod.yml
cat docker-compose-prod.yml
- name: Up docker compose prod
uses: yu-ichiro/spin-up-docker-compose-action@v1
with:
file: docker-compose-prod.yml
- name: Sleep for 60 seconds
run: sleep 60s
shell: bash
- name: Verify app is up
run: curl -v --fail http://localhost:8080/version || exit 1
- uses: matt-ball/newman-action@master
name: Run Postman tests
with:
collection: postman/api.json
environment: postman/env.json