rex-7567-e27
ActionsTags
(2)Redeploy docker compose containers after git push
This will install Rex's server which will allow deploying your app
- You can use the latest binary release in the releases
- Or if that doesn't work, compile it yourself using
go build -ldflags="-w -s"
- Create a
.envfile by copying the examplecp .env.example .envif you run windows on your server I have nothing to say to you, except WHY!!
- Modify the fields as you like, make sure to not share your token, since you'll use it in the action to deploy the repo, and it being public is not good news :)
- Install the systemd service, since I haven't figured out how to make this fully work in docker :(
# /etc/systemd/system/rex.service
[Unit]
Description=Rex
[Service]
Type=simple
User=yourusername # so that git will work, and the other docker stuff
WorkingDirectory=/path/to/rex/binary/and/env/file # they must be in the same directory, otherwise it won't work :)
ExecStart=/path/to/rex/binary
Restart=always
[Install]
WantedBy=multi-user.target
6. Reload systemd's daemons and start the server
sudo systemctl daemon-reload
sudo systemctl enable --now rexThis where the fun begins.
- Add a secret to your GitHub Repo called
REX_KEYwith the same value that you've set on the server- You can add the server url as a secret as well if you prefer to :)
- Create the GitHub action under
.github/workflows/rex-build.yml
jobs:
rex-deploy:
runs-on: ubuntu-latest
steps:
- name: rex-7567-e27
uses: mbaraa/rex-action@v1.6.3
with:
server-url: example.com
token: ${{ secrets.REX_KEY }}
repo-name: repoName
# commit-sha is optional :)
commit-sha: ${{ github.sha }}
# latest-tag is optional :)
latest-tag: ${{ github.ref }}- Do a push and see the magic happen
This action was generated using this doc.
rex-7567-e27 is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.