# Anyone using Github actions for your deployments?

**URL:** <https://forum.elixirforum.com/t/anyone-using-github-actions-for-your-deployments/31210>\
**Category:** Questions\
**Tags:** mix-releases\
**Created:** [May 3, 2020, 7:22pm UTC](https://forum.elixirforum.com/t/anyone-using-github-actions-for-your-deployments/31210 "2020-05-03T19:22:18Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![egze](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/egze/32/13522_2.png) [@egze](https://forum.elixirforum.com/u/egze)\
**Post date:** [May 3, 2020, 8:24pm UTC](https://forum.elixirforum.com/t/anyone-using-github-actions-for-your-deployments/31210/3 "2020-05-03T20:24:57Z")

</div>

I do something similar, but with GitLab CI.

```yaml
script:
    - ssh-add <(echo "$PRODUCTION_PRIVATE_KEY")
    - VERSION_FOLDER=`date +%F_%T`
    - scp -P$PRODUCTION_SSH_PORT -r release.tar.gz $PRODUCTION_DEPLOY_USER@$PRODUCTION_HOST:/var/www/apps/myapp
    - ssh -p$PRODUCTION_SSH_PORT $PRODUCTION_DEPLOY_USER@$PRODUCTION_HOST "mkdir -p /var/www/apps/myapp/versions/$VERSION_FOLDER"
    - ssh -p$PRODUCTION_SSH_PORT $PRODUCTION_DEPLOY_USER@$PRODUCTION_HOST "sudo /bin/systemctl stop myapp.service"
    - ssh -p$PRODUCTION_SSH_PORT $PRODUCTION_DEPLOY_USER@$PRODUCTION_HOST "tar -xf /var/www/apps/myapp/release.tar.gz -C /var/www/apps/myapp/versions/$VERSION_FOLDER"
    - ssh -p$PRODUCTION_SSH_PORT $PRODUCTION_DEPLOY_USER@$PRODUCTION_HOST "ln -sfn /var/www/apps/myapp/versions/$VERSION_FOLDER /var/www/apps/myapp/current"
    - ssh -p$PRODUCTION_SSH_PORT $PRODUCTION_DEPLOY_USER@$PRODUCTION_HOST "sudo /bin/systemctl start myapp.service"
    - ssh -p$PRODUCTION_SSH_PORT $PRODUCTION_DEPLOY_USER@$PRODUCTION_HOST "ls -dt /var/www/apps/myapp/versions/* | tail -n +5 | xargs rm -rf"

```

I start/stop services with systemd. Took the config here, I think [https://mfeckie.github.io/Phoenix-In-Production-With-Systemd/](https://mfeckie.github.io/Phoenix-In-Production-With-Systemd/)

---

_[View the full topic](https://forum.elixirforum.com/t/anyone-using-github-actions-for-your-deployments/31210)._
