Skip to content

chore(deps): update dependency vcrpy to v6.0.2 #260

chore(deps): update dependency vcrpy to v6.0.2

chore(deps): update dependency vcrpy to v6.0.2 #260

name: Docker Build and Push
on:
pull_request:
types:
- closed
jobs:
build-and-push:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get version from script
id: get_version
working-directory: poradnia
run: |
echo "version=$(python version.py)" >> $GITHUB_ENV
- name: Get deployment env
id: get_deployment
run: |
if [[ $GITHUB_REF == *"master"* ]]; then
DEPLOYMENT="prod"
elif [[ $GITHUB_REF == *"dev"* ]]; then
DEPLOYMENT="staging"
else
DEPLOYMENT=${GITHUB_REF#refs/heads/}
fi
echo "deployment=$DEPLOYMENT" >> $GITHUB_ENV
env
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PAT }}
- name: Display contents of code directory
run: ls -la
- name: Display contents of .git directory
run: ls -la .git
- name: Create git copy
run: cp -r .git .git_copy
- name: Show git status
run: git status
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: .contrib/docker/Dockerfile.web.production
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/${{ vars.REPO_NAME }}:latest-${{ env.deployment }}
${{ secrets.DOCKER_USERNAME }}/${{ vars.REPO_NAME }}:${{ env.version }}-${{ env.deployment }}
- name: Remove git copy
run: rm -rf .git_copy