Merge pull request #209 from pagarme/feature/PAOPN-456-refactor-pix-b… #67
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
name: CD | |
on: | |
push: | |
branches: | |
- develop | |
- test | |
- stg | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout Code | |
uses: actions/checkout@v3 | |
- | |
name: Copy CI files to root | |
run: | | |
cp .github/data/auth.json . | |
cp .github/data/docker-compose.yml . | |
cp .github/data/Dockerfile . | |
cp .github/data/wait-for-mysql.sh . | |
cp .github/data/magento2_module_install.sql . | |
- | |
name: Build image base for modifications | |
run: | | |
ls | |
docker compose up -d | |
- | |
name: Activate and setup Plugin | |
run: docker ps | |
- | |
name: Log in to Docker Hub | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: mpdockerregistry.azurecr.io | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- | |
name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: mpdockerregistry.azurecr.io/magento2-pagarme | |
- | |
name: Build and push Docker image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
# name: Commit and push Docker image | |
# run: | | |
# sleep 5 && docker stop magento2_bitnami | |
# docker login ${{ secrets.DOCKER_ACCOUNT }} -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
# docker commit magento2_bitnami "magento2-pagarme:${{ github.ref_name }}" | |
# docker push "magento2-pagarme:${{ github.ref_name }}" | |
# name: Send deployment webhook to Rancher | |
# run: | | |
# BODY='{"push_data":{"tag":"'"${{ github.ref }}"'"},"repository":{"repo_name":"'"${{ secrets.DOCKER_ACCOUNT }}/${{ github.repository }}"'"}}' | |
# curl -X POST ${{ secrets.RANCHER_STG_DEPLOY_URL }} -H 'Content-Type: application/json' -d "${BODY}" |