Deploy Your Code To The Production Environment From Github

What Is Challenge Here?

How To Solve?

How To Do?

$ echo "your-secret-password" > ansible_vault_password.txt &&\
ansible-vault \
encrypt \
--vault-password-file=ansible_vault_password.txt \
~/.ssh/id_rsa \
--output=id_rsa-encrypted &&\
rm ansible_vault_password.txt
FROM alpine
RUN apk add --update ansible
COPY entrypoint.sh /.
ENTRYPOINT ["entrypoint.sh"]
#!/bin/shmkdir ~/.sshecho $VAULT_PASS > /vault_password_file.txtansible-vault decrypt \
--vault-password-file=/vault_password_file.txt \
id_rsa-encrypted \
--output=~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsaansible-playbook --vault-password-file=/vault_password_file.txt \
-i ansible/hosts \
ansible/deploy.yml
name: 'Deploy'
descript: 'Makes deployment to the production'
runs:
using: 'docker'
image: 'Dockerfile'
name: 'Production Build'
# ...
jobs
:
#...
deploy:
runs-on: ubuntu-latest
needs: build # The build job should finished successfully.
steps:
- uses: actions/checkout@v1
- uses: ./.github/actions/deploy
env:
VAULT_PASS: ${{ secrets.VAULT_PASS }}

Credits:

Just another software developer Github: https://github.com/ibrahimgunduz34 Linkedin: linkedin.com/in/ibrahimgunduz

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store